lkml.org 
[lkml]   [2019]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3] cpu/hotplug: Cache number of online CPUs
----- 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

\
 
 \ /
  Last update: 2019-07-09 17:52    [W:0.245 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site