lkml.org 
[lkml]   [2013]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kmod: Run usermodehelpers only on cpus allowed for kthreadd
On Thu, Oct 17, 2013 at 03:24:36PM +0000, Christoph Lameter wrote:
> On Thu, 17 Oct 2013, Frederic Weisbecker wrote:
>
> > > - /* We can run anywhere, unlike our parent keventd(). */
> > > - set_cpus_allowed_ptr(current, cpu_all_mask);
> > > + /* We can run anywhere kthreadd can run */
> > > + set_kthreadd_affinity();
> >
> > If you really want your isolated CPUs to be undisturbed, you need this affinity to
> > be set before the creation of this usermode helper. Otherwise it's going to run to any random
> > place before you call the above function.
> >
> > Is there now way to control the kworker affinity which create this usermode helpers threads
> > instead?
>
> The invocation is coming from keventd so the affinity seems to be set to
> a different cpu before we get the thread moved.

Looking at alloc_singlethread_workqueue(), it seems to create a kthread by using
kthread_create(). So I guess the resulting works have the affinity of that kthread.
And thus call_usermodehelper() initially has that affinity, until it spreads it explicitly
to all CPUs.

Couldn't we instead make kthread children (those created with kthread_create()) to inherit
kthread initial affinity? Currently kthread's children have cpu_all_mask. We could change
that behaviour. This way the initial kthread affinity could be inherited all along.

>
> A tsc loop is running on the processor that gets hit by the usermodehelper spawns.
>
> We see spawning by the tty notifier (when typing on a vt) as well as by a
> mellanox driver (periodically).>


\
 
 \ /
  Last update: 2013-10-17 18:41    [W:0.060 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site