lkml.org 
[lkml]   [2021]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] sched: Fix PF_NO_SETAFFINITY blind inheritance
Date

Hi Frederic,

Sorry about that one; thanks for having dug into it.

On 26/05/21 01:58, Frederic Weisbecker wrote:
> One way to solve the PF_NO_SETAFFINITY issue is to not inherit this flag
> on copy_process() at all. The cases where it matters are:
>
> * fork_idle(): explicitly set the flag already.
> * fork() syscalls: userspace tasks that shouldn't be concerned by that.
> * create_io_thread(): the callers explicitly attribute the flag to the
> newly created tasks.
> * kernel_thread():
> _ Fix the issues on init/1 and kthreadd
> _ Fix the issues on kthreadd children.
> _ Usermode helper created by an unbound workqueue. This shouldn't
> matter. In the worst case it gives more control to userspace
> on setting affinity to these short living tasks although this can
> be tuned with inherited unbound workqueues affinity already.
>

(I just saw it got shoved into tip already, but in any case:)

That makes sense to me. Regarding the UMH point, I don't believe there are
others like it creeping around; otherwise we might've had to go with e.g.

p->flags &= ~(... | (PF_NO_SETAFFINITY * !!(p->flags & PF_IDLE)))

but per the above that doesn't seem necessary.

Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>

\
 
 \ /
  Last update: 2021-05-26 12:11    [W:0.057 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site