lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 8 Apr 2015 19:29:04 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Chris Metcalf <cmetcalf@...hip.com>
Cc:	Don Zickus <dzickus@...hat.com>, Ingo Molnar <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andrew Jones <drjones@...hat.com>,
	chai wen <chaiw.fnst@...fujitsu.com>,
	Ulrich Obergfell <uobergfe@...hat.com>,
	Fabian Frederick <fabf@...net.be>,
	Aaron Tomlin <atomlin@...hat.com>,
	Ben Zhang <benzh@...omium.org>,
	Christoph Lameter <cl@...ux.com>,
	Gilad Ben-Yossef <gilad@...yossef.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	linux-kernel@...r.kernel.org, Jonathan Corbet <corbet@....net>,
	linux-doc@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v5 1/2] smpboot: allow excluding cpus from the smpboot
 threads

On Wed, Apr 08, 2015 at 10:06:44AM -0400, Chris Metcalf wrote:
> On 04/08/2015 09:28 AM, Frederic Weisbecker wrote:
> >On Mon, Apr 06, 2015 at 03:45:55PM -0400, cmetcalf@...hip.com wrote:
> >>From: Chris Metcalf <cmetcalf@...hip.com>
> >>
> >>This change allows some cores to be excluded from running the
> >>smp_hotplug_thread tasks.  The motivating example for this is
> >>the watchdog threads, which by default we don't want to run
> >>on any enabled nohz_full cores.
> >>
> >>Signed-off-by: Chris Metcalf <cmetcalf@...hip.com>
> >>---
> >>  include/linux/smpboot.h |  2 ++
> >>  kernel/smpboot.c        | 11 ++++++++---
> >>  2 files changed, 10 insertions(+), 3 deletions(-)
> >>
> >>diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h
> >>index d600afb21926..de2f64a98108 100644
> >>--- a/include/linux/smpboot.h
> >>+++ b/include/linux/smpboot.h
> >>@@ -27,6 +27,7 @@ struct smpboot_thread_data;
> >>   * @pre_unpark:		Optional unpark function, called before the thread is
> >>   *			unparked (cpu online). This is not guaranteed to be
> >>   *			called on the target cpu of the thread. Careful!
> >>+ * @exclude_mask:	Optional cpumask, specifying cores to exclude.
> >>   * @selfparking:	Thread is not parked by the park function.
> >>   * @thread_comm:	The base name of the thread
> >>   */
> >>@@ -41,6 +42,7 @@ struct smp_hotplug_thread {
> >>  	void				(*park)(unsigned int cpu);
> >>  	void				(*unpark)(unsigned int cpu);
> >>  	void				(*pre_unpark)(unsigned int cpu);
> >>+	cpumask_t			*exclude_mask;
> >The usual pattern for cpumasks is to use them as affinity values instead
> >of non-affinity values.
> 
> Yes.  The issue here is that as cpus come and go from the hotplug set,
> the ones that we want to exclude remain fixed.  If we do it the way you
> propose (and it's the way I originally did it), it means that if a new cpu
> comes online you automatically treat it as nohz_full, which seems wrong
> to me.  I suppose we could add another callback so that the
> smp_hotplug_thread struct could explicitly decide how to mark any
> new cpu that comes online, but that all seems more complicated than
> my final suggestion.
> 
> What do you think?

No cpumasks are allocated to handle any cpu from the cpu_possible_mask.
So imagine that CPU 1 is offline and CPU 0 is online. It's perfectly
fine to write 0x3 to the cpumask, which means it's affine to both, then
if CPU 1 is turned online later, the smpboot subsystem takes care of it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ