All of lore.kernel.org
 help / color / mirror / Atom feed
* + kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch added to -mm tree
@ 2015-07-07 23:09 akpm
  2015-07-07 23:32 ` Oleg Nesterov
  0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2015-07-07 23:09 UTC (permalink / raw)
  To: fweisbec, cl, oleg, riel, rusty, tj, mm-commits


The patch titled
     Subject: kmod: remove unecessary explicit wide CPU affinity setting
has been added to the -mm tree.  Its filename is
     kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Frederic Weisbecker <fweisbec@gmail.com>
Subject: kmod: remove unecessary explicit wide CPU affinity setting

The call_usermodehelper_exec_[a]sync() kernel threads are created by
khelper precisely because we want them to be affine to all CPUs,
irrespective of any call_usermodehelper() caller with reduced CPU
affinity.  So this explicit all-CPUs wide affinity forcing is useless.

Not only useless it even breaks nohz full.  The housekeeping work (general
kernel internal code that user doesn't care much about) is handled by a
reduced set of CPUs in nohz full, precisely those that are not included by
nohz_full= kernel parameters.  For example unbound workqueues are handled
by housekeeping CPUs.  And we want the usermodehelper tasks to be handled
by housekeeping CPUs because they are kernel internals that user critical
nohz full work don't want to be disturbed by.

In nohz full configurations, khelper will naturally be affine to
housekeeping CPUs and this housekeeping affinity is then inherited by
usermodehelper kernel threads.  But the explicit call to
set_cpus_allowed_ptr() breaks that.

Simply remove it.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/kmod.c |    3 ---
 1 file changed, 3 deletions(-)

diff -puN kernel/kmod.c~kmod-remove-unecessary-explicit-wide-cpu-affinity-setting kernel/kmod.c
--- a/kernel/kmod.c~kmod-remove-unecessary-explicit-wide-cpu-affinity-setting
+++ a/kernel/kmod.c
@@ -223,9 +223,6 @@ static int call_usermodehelper_exec_asyn
 	flush_signal_handlers(current, 1);
 	spin_unlock_irq(&current->sighand->siglock);
 
-	/* We can run anywhere, unlike our parent keventd(). */
-	set_cpus_allowed_ptr(current, cpu_all_mask);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: + kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch added to -mm tree
  2015-07-07 23:09 + kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch added to -mm tree akpm
@ 2015-07-07 23:32 ` Oleg Nesterov
  2015-07-08 12:52   ` Frederic Weisbecker
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Nesterov @ 2015-07-07 23:32 UTC (permalink / raw)
  To: akpm; +Cc: fweisbec, cl, riel, rusty, tj, linux-kernel

Well, sorry for noise.

Let me repeat that I agree with this change, but...

On 07/07, Andrew Morton wrote:
>
> From: Frederic Weisbecker <fweisbec@gmail.com>
> Subject: kmod: remove unecessary explicit wide CPU affinity setting
>
> Not only useless it even breaks nohz full.  The housekeeping work (general
> kernel internal code that user doesn't care much about) is handled by a
> reduced set of CPUs in nohz full, precisely those that are not included by
> nohz_full= kernel parameters.  For example unbound workqueues are handled
> by housekeeping CPUs.

I still think this part of the changelog looks confusing and just wrong.

It is not that it breaks nohz full, unbound workqueues have nothing to
do with housekeeping_mask from the kernel pov. But yes, people can change
->cpumask and this can connect to housekeeping_mask.

Frederic, may I ask you to update the changelog? Although perhaps it was
just me who was confused...

Oleg.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: + kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch added to -mm tree
  2015-07-07 23:32 ` Oleg Nesterov
@ 2015-07-08 12:52   ` Frederic Weisbecker
  0 siblings, 0 replies; 4+ messages in thread
From: Frederic Weisbecker @ 2015-07-08 12:52 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: akpm, cl, riel, rusty, tj, linux-kernel

On Wed, Jul 08, 2015 at 01:32:26AM +0200, Oleg Nesterov wrote:
> Well, sorry for noise.
> 
> Let me repeat that I agree with this change, but...
> 
> On 07/07, Andrew Morton wrote:
> >
> > From: Frederic Weisbecker <fweisbec@gmail.com>
> > Subject: kmod: remove unecessary explicit wide CPU affinity setting
> >
> > Not only useless it even breaks nohz full.  The housekeeping work (general
> > kernel internal code that user doesn't care much about) is handled by a
> > reduced set of CPUs in nohz full, precisely those that are not included by
> > nohz_full= kernel parameters.  For example unbound workqueues are handled
> > by housekeeping CPUs.
> 
> I still think this part of the changelog looks confusing and just wrong.

I agree!

> 
> It is not that it breaks nohz full, unbound workqueues have nothing to
> do with housekeeping_mask from the kernel pov. But yes, people can change
> ->cpumask and this can connect to housekeeping_mask.

Right. In fact that's the motivation of the patch but the connection is
much more indirect than what the changelog suggests. So I'll fix the changelog.

> 
> Frederic, may I ask you to update the changelog? Although perhaps it was
> just me who was confused...

Sure! I think Andrew applied the patches to keep track of them and make sure
they don't get lost. But I'm working on a new iteration to replace them.

Thanks!

> Oleg.
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* + kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch added to -mm tree
@ 2015-08-14 20:49 akpm
  0 siblings, 0 replies; 4+ messages in thread
From: akpm @ 2015-08-14 20:49 UTC (permalink / raw)
  To: fweisbec, cl, oleg, riel, rusty, tj, mm-commits


The patch titled
     Subject: kmod: remove unecessary explicit wide CPU affinity setting
has been added to the -mm tree.  Its filename is
     kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Frederic Weisbecker <fweisbec@gmail.com>
Subject: kmod: remove unecessary explicit wide CPU affinity setting

Khelper is affine to all CPUs.  Now since it creates the
call_usermodehelper_exec_[a]sync() kernel threads, those inherit the wide
affinity.

As such explicitly forcing a wide affinity from those kernel threads
is like a no-op.

Just remove it. It's needless and it breaks CPU isolation users who
rely on workqueue affinity tuning.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/kmod.c |    3 ---
 1 file changed, 3 deletions(-)

diff -puN kernel/kmod.c~kmod-remove-unecessary-explicit-wide-cpu-affinity-setting kernel/kmod.c
--- a/kernel/kmod.c~kmod-remove-unecessary-explicit-wide-cpu-affinity-setting
+++ a/kernel/kmod.c
@@ -224,9 +224,6 @@ static int call_usermodehelper_exec_asyn
 	flush_signal_handlers(current, 1);
 	spin_unlock_irq(&current->sighand->siglock);
 
-	/* We can run anywhere, unlike our parent keventd(). */
-	set_cpus_allowed_ptr(current, cpu_all_mask);
-
 	/*
 	 * Our parent is keventd, which runs with elevated scheduling priority.
 	 * Avoid propagating that into the userspace child.
_

Patches currently in -mm which might be from fweisbec@gmail.com are

smpboot-fix-memory-leak-on-error-handling.patch
smpboot-make-cleanup-to-mirror-setup.patch
smpboot-allow-to-pass-the-cpumask-on-per-cpu-thread-registration.patch
smpboot-allow-to-pass-the-cpumask-on-per-cpu-thread-registration-fix.patch
watchdog-simplify-housekeeping-affinity-with-the-appropriate-mask.patch
watchdog-introduce-watchdog_park_threads-and-watchdog_unpark_threads.patch
watchdog-introduce-watchdog_suspend-and-watchdog_resume.patch
watchdog-use-park-unpark-functions-in-update_watchdog_all_cpus.patch
watchdog-use-suspend-resume-interface-in-fixup_ht_bug.patch
watchdog-use-suspend-resume-interface-in-fixup_ht_bug-fix-2.patch
watchdog-rename-watchdog_suspend-and-watchdog_resume.patch
kmod-bunch-of-internal-functions-renames.patch
kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch
kmod-add-up-to-date-explanations-on-the-purpose-of-each-asynchronous-levels.patch
kmod-use-system_unbound_wq-instead-of-khelper.patch
kmod-handle-umh_wait_proc-from-system-unbound-workqueue.patch
linux-next.patch


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-14 20:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07 23:09 + kmod-remove-unecessary-explicit-wide-cpu-affinity-setting.patch added to -mm tree akpm
2015-07-07 23:32 ` Oleg Nesterov
2015-07-08 12:52   ` Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2015-08-14 20:49 akpm

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.