Messages in this thread | | | Date | Thu, 3 Oct 2013 09:27:28 -0700 | From | "Paul E. McKenney" <> | Subject | Re: [PATCH 1/3] hotplug: Optimize {get,put}_online_cpus() |
| |
On Thu, Oct 03, 2013 at 04:01:50PM +0200, Peter Zijlstra wrote: > On Wed, Oct 02, 2013 at 04:56:56PM +0200, Peter Zijlstra wrote: > > + if (atomic_dec_and_test(&cpuhp_waitcount)) > > + wake_up(&cpuhp_writer); > > + > > + goto again: > > } > > > + > > +#define per_cpu_sum(var) \ > > +({ \ > > + typeof(var) __sum = 0; \ > > + int cpu; \ > > + for_each_possible_cpu(cpu) \ > > + __sum += per_cpu(var, cpu); \ > > + __sum; \ > > +)} > > > > I just noticed I forgot a refresh..
And including these changes as well. ;-)
Thanx, Paul
> +++ b/kernel/cpu.c > @@ -120,7 +120,7 @@ void __get_online_cpus(void) > if (atomic_dec_and_test(&cpuhp_waitcount)) > wake_up(&cpuhp_writer); > > - goto again: > + goto again; > } > EXPORT_SYMBOL_GPL(__get_online_cpus); > > @@ -146,7 +146,7 @@ EXPORT_SYMBOL_GPL(__put_online_cpus); > for_each_possible_cpu(cpu) \ > __sum += per_cpu(var, cpu); \ > __sum; \ > -)} > +}) > > /* > * See srcu_readers_active_idx_check() for a rather more detailed explanation. >
| |