[lkml]   [2013]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH]: exec: avoid propagating PF_NO_SETAFFINITY into userspace child
On 11/28, Peter Zijlstra wrote:
> On Thu, Nov 28, 2013 at 12:45:42PM +0100, Oleg Nesterov wrote:
> > It has? khelper is a workqueue thread, this flag is set by create_worker().
> >
> > And it does kernel_thread() (not kthread_create()) so the child gets this
> > flag too.
> Urgh, but that's still completely wrong. khelper is a singlethread
> workqueue, those should be unbound and therefore should not have this
> flag set at all.

Well. This is debatable, but I leave this to you and Tejun ;)


> In fact, I know people want to set affinity on khelper

This is not that simple. Note that khelper itself is the rescuer thread,
it doesn't not process the works. There are other kworker/u* threads which
run the work queued on khelper_wq. There is a pool of threads.

> to ensure all the
> usermode helper tasks get spawned on the specific system-cpus and leave
> the rest of the system unperturbed.

I _guess_ usermodehelper_init() should use WQ_SYSFS then, and in this case
the user can write to wq_cpumask_store somewhere in /sys/.

Not sure I read this code correctly though, I didn't check.

But PF_NO_SETAFFINITY should be cleared on exec anyway, so I still think
the patch does the right thing.


 \ /
  Last update: 2013-11-28 15:01    [W:0.611 / U:1.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site