From: Frederic Weisbecker <fweisbec@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: Mike Galbraith <bitbucket@online.de>,
Thomas Gleixner <tglx@linutronix.de>,
Gilad Ben-Yossef <gilad@benyossef.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Mike Frysinger <vapier@gentoo.org>
Subject: Re: [PATCH] kmod: Run usermodehelpers only on cpus allowed for kthreadd
Date: Thu, 17 Oct 2013 15:55:11 +0200 [thread overview]
Message-ID: <20131017135509.GB28963@localhost.localdomain> (raw)
In-Reply-To: <00000141c1b99b20-64f9d142-961a-447e-8ebe-40f86b638278-000000@email.amazonses.com>
On Wed, Oct 16, 2013 at 02:44:28PM +0000, Christoph Lameter wrote:
> This is a follow on patch related to the earlier
> discussion about restricting the
> spawning of kernel threads. See https://lkml.org/lkml/2013/9/5/426
>
>
>
>
> usermodehelper() threads can currently run on all processors.
> This is an issue for low latency cores.
This might be redundant with akpm's reply but here we go:
low latency is a very confusing term nowadays. It's used by real time
to describe the time it takes for a high prio task to take the CPU,
and it's used by you for extreme HPC mode for deterministic undisturbed
throughput.
The changelog needs to be expanded to describe what's needed, or people
will be confused when they will stare at that git blame line in one year from now :)
>
> Restrict usermodehelper() threads to the cores that kthreadd is
> restricted to.
>
> The default for kthreadd is to be allowed to run on an processors.
s/an/all ?
> If the user restricts kthreadd then threads spawned by
> usermodhelper() will similarly restricted.
>
> Before this patch there is no way to limit the cpus that usermodehelper
> can run on since the affinity is set when the thread is spawned to
> all processors.
>
> Signed-off-by: Christoph Lameter <cl@linux.com>
>
> Index: linux/include/linux/kthread.h
> ===================================================================
> --- linux.orig/include/linux/kthread.h 2013-10-10 11:00:34.167771996 -0500
> +++ linux/include/linux/kthread.h 2013-10-15 13:57:52.859056676 -0500
> @@ -51,6 +51,7 @@ void kthread_parkme(void);
> int kthreadd(void *unused);
> extern struct task_struct *kthreadd_task;
> extern int tsk_fork_get_node(struct task_struct *tsk);
> +void set_kthreadd_affinity(void);
>
> /*
> * Simple work processor based on kthread.
> Index: linux/kernel/kmod.c
> ===================================================================
> --- linux.orig/kernel/kmod.c 2013-10-10 11:00:39.091771917 -0500
> +++ linux/kernel/kmod.c 2013-10-15 14:02:01.904261324 -0500
> @@ -40,6 +40,7 @@
> #include <linux/ptrace.h>
> #include <linux/async.h>
> #include <asm/uaccess.h>
> +#include <linux/kthread.h>
>
> #include <trace/events/module.h>
>
> @@ -209,8 +210,8 @@ static int ____call_usermodehelper(void
> flush_signal_handlers(current, 1);
> spin_unlock_irq(¤t->sighand->siglock);
>
> - /* 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?
next prev parent reply other threads:[~2013-10-17 13:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-16 14:44 [PATCH] kmod: Run usermodehelpers only on cpus allowed for kthreadd Christoph Lameter
2013-10-16 21:13 ` Andrew Morton
2013-10-16 22:37 ` Christoph Lameter
2013-10-17 19:23 ` Andrew Morton
2013-11-07 16:43 ` [PATCH] kmod: Run usermodehelpers only on cpus allowed for kthreadd V2 Christoph Lameter
2013-11-07 22:50 ` Frederic Weisbecker
2013-11-08 15:06 ` Christoph Lameter
2013-11-08 16:31 ` Frederic Weisbecker
2013-11-08 17:05 ` Christoph Lameter
2013-11-08 19:12 ` Frederic Weisbecker
2013-11-08 19:52 ` Christoph Lameter
2013-11-08 20:06 ` Frederic Weisbecker
2014-04-08 20:57 ` Andrew Morton
2014-04-08 21:56 ` Frederic Weisbecker
2013-10-17 13:55 ` Frederic Weisbecker [this message]
2013-10-17 15:24 ` [PATCH] kmod: Run usermodehelpers only on cpus allowed for kthreadd Christoph Lameter
2013-10-17 16:07 ` Frederic Weisbecker
2013-10-17 17:50 ` Andrew Morton
2013-10-17 18:24 ` Christoph Lameter
2013-10-17 22:27 ` Frederic Weisbecker
2013-10-20 18:00 ` Christoph Lameter
2013-10-17 18:23 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131017135509.GB28963@localhost.localdomain \
--to=fweisbec@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bitbucket@online.de \
--cc=cl@linux.com \
--cc=gilad@benyossef.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.