From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: paulmck <paulmck@linux.ibm.com>, Ingo Molnar <mingo@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>, x86 <x86@kernel.org>,
Nadav Amit <namit@vmware.com>,
Peter Zijlstra <peterz@infradead.org>,
Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH V3] cpu/hotplug: Cache number of online CPUs
Date: Tue, 9 Jul 2019 11:52:18 -0400 (EDT) [thread overview]
Message-ID: <262027381.15855.1562687538131.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1907091622590.1634@nanos.tec.linutronix.de>
----- On Jul 9, 2019, at 10:23 AM, Thomas Gleixner tglx@linutronix.de wrote:
[...]
> +void set_cpu_online(unsigned int cpu, bool online)
> +{
> + /*
> + * atomic_inc/dec() is required to handle the horrid abuse of this
> + * function by the reboot and kexec code which invokes it from
invokes -> invoke
> + * IPI/NMI broadcasts when shutting down CPUs. Inocation from
Inocation -> Invocation
The rest looks good!
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> + * regular CPU hotplug is properly serialized.
> + *
> + * Note, that the fact that __num_online_cpus is of type atomic_t
> + * does not protect readers which are not serialized against
> + * concurrent hotplug operations.
> + */
> + if (online) {
> + if (!cpumask_test_and_set_cpu(cpu, &__cpu_online_mask))
> + atomic_inc(&__num_online_cpus);
> + } else {
> + if (cpumask_test_and_clear_cpu(cpu, &__cpu_online_mask))
> + atomic_dec(&__num_online_cpus);
> + }
> +}
> +
> /*
> * Activate the first processor.
> */
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2019-07-09 15:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 20:42 [PATCH] cpu/hotplug: Cache number of online CPUs Thomas Gleixner
2019-07-04 20:59 ` Mathieu Desnoyers
2019-07-04 21:10 ` Thomas Gleixner
2019-07-04 22:00 ` Mathieu Desnoyers
2019-07-04 22:33 ` Thomas Gleixner
2019-07-04 23:34 ` Mathieu Desnoyers
2019-07-05 8:49 ` Ingo Molnar
2019-07-05 15:38 ` Mathieu Desnoyers
2019-07-05 20:53 ` Thomas Gleixner
2019-07-05 21:00 ` Thomas Gleixner
2019-07-06 23:24 ` Mathieu Desnoyers
2019-07-08 13:43 ` [PATCH V2] " Thomas Gleixner
2019-07-08 14:07 ` Paul E. McKenney
2019-07-08 14:20 ` Thomas Gleixner
2019-07-09 14:23 ` [PATCH V3] " Thomas Gleixner
2019-07-09 15:52 ` Mathieu Desnoyers [this message]
2019-07-22 7:58 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2019-07-25 14:11 ` tip-bot for Thomas Gleixner
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=262027381.15855.1562687538131.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namit@vmware.com \
--cc=paulmck@linux.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.com \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox