Messages in this thread | | | Date | Tue, 9 Jul 2019 11:52:18 -0400 (EDT) | From | Mathieu Desnoyers <> | Subject | Re: [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
| |