Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-06 Thread Mathieu Desnoyers
- On Jul 5, 2019, at 5:00 PM, Thomas Gleixner t...@linutronix.de wrote: > On Fri, 5 Jul 2019, Thomas Gleixner wrote: >> On Fri, 5 Jul 2019, Mathieu Desnoyers wrote: >> > - On Jul 5, 2019, at 4:49 AM, Ingo Molnar mi...@kernel.org wrote: >> > > * Mathieu Desnoyers wrote: >> > >> The semanti

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-05 Thread Thomas Gleixner
On Fri, 5 Jul 2019, Thomas Gleixner wrote: > On Fri, 5 Jul 2019, Mathieu Desnoyers wrote: > > - On Jul 5, 2019, at 4:49 AM, Ingo Molnar mi...@kernel.org wrote: > > > * Mathieu Desnoyers wrote: > > >> The semantic I am looking for here is C11's relaxed atomics. > > > > > > What does this mean?

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-05 Thread Thomas Gleixner
On Fri, 5 Jul 2019, Mathieu Desnoyers wrote: > - On Jul 5, 2019, at 4:49 AM, Ingo Molnar mi...@kernel.org wrote: > > * Mathieu Desnoyers wrote: > >> The semantic I am looking for here is C11's relaxed atomics. > > > > What does this mean? > > C11 states: > > "Atomic operations specifying me

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-05 Thread Mathieu Desnoyers
- On Jul 5, 2019, at 4:49 AM, Ingo Molnar mi...@kernel.org wrote: > * Mathieu Desnoyers wrote: > >> - On Jul 4, 2019, at 6:33 PM, Thomas Gleixner t...@linutronix.de wrote: >> >> > On Thu, 4 Jul 2019, Mathieu Desnoyers wrote: >> >> - On Jul 4, 2019, at 5:10 PM, Thomas Gleixner t..

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-05 Thread Ingo Molnar
* Mathieu Desnoyers wrote: > - On Jul 4, 2019, at 6:33 PM, Thomas Gleixner t...@linutronix.de wrote: > > > On Thu, 4 Jul 2019, Mathieu Desnoyers wrote: > >> - On Jul 4, 2019, at 5:10 PM, Thomas Gleixner t...@linutronix.de wrote: > >> > > >> > num_online_cpus() is racy today vs. CPU hot

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-04 Thread Mathieu Desnoyers
- On Jul 4, 2019, at 6:33 PM, Thomas Gleixner t...@linutronix.de wrote: > On Thu, 4 Jul 2019, Mathieu Desnoyers wrote: >> - On Jul 4, 2019, at 5:10 PM, Thomas Gleixner t...@linutronix.de wrote: >> > >> > num_online_cpus() is racy today vs. CPU hotplug operations as >> > long as you don't h

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-04 Thread Thomas Gleixner
On Thu, 4 Jul 2019, Mathieu Desnoyers wrote: > - On Jul 4, 2019, at 5:10 PM, Thomas Gleixner t...@linutronix.de wrote: > > > > num_online_cpus() is racy today vs. CPU hotplug operations as > > long as you don't hold the hotplug lock. > > Fair point, AFAIU none of the loads performed within num

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-04 Thread Mathieu Desnoyers
- On Jul 4, 2019, at 5:10 PM, Thomas Gleixner t...@linutronix.de wrote: > On Thu, 4 Jul 2019, Mathieu Desnoyers wrote: > >> - On Jul 4, 2019, at 4:42 PM, Thomas Gleixner t...@linutronix.de wrote: >> >> > Revaluating the bitmap wheight of the online cpus bitmap in every >> > invocation of

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-04 Thread Thomas Gleixner
On Thu, 4 Jul 2019, Mathieu Desnoyers wrote: > - On Jul 4, 2019, at 4:42 PM, Thomas Gleixner t...@linutronix.de wrote: > > > Revaluating the bitmap wheight of the online cpus bitmap in every > > invocation of num_online_cpus() over and over is a pretty useless > > exercise. Especially when nu

Re: [PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-04 Thread Mathieu Desnoyers
- On Jul 4, 2019, at 4:42 PM, Thomas Gleixner t...@linutronix.de wrote: > Revaluating the bitmap wheight of the online cpus bitmap in every > invocation of num_online_cpus() over and over is a pretty useless > exercise. Especially when num_online_cpus() is used in code pathes like the > IPI de

[PATCH] cpu/hotplug: Cache number of online CPUs

2019-07-04 Thread Thomas Gleixner
Revaluating the bitmap wheight of the online cpus bitmap in every invocation of num_online_cpus() over and over is a pretty useless exercise. Especially when num_online_cpus() is used in code pathes like the IPI delivery of x86 or the membarrier code. Cache the number of online CPUs in the core an