Re: [RFC PATCH 1/2] percpu_counter: Allow falling back to global counter on large system

2016-03-19 Thread Waiman Long
On 03/07/2016 01:24 PM, Christoph Lameter wrote: On Fri, 4 Mar 2016, Waiman Long wrote: This patch provides a mechanism to selectively degenerate per-cpu counters to global counters at per-cpu counter initialization time. The following new API is added: percpu_counter_set_limit(struct percp

Re: [RFC PATCH 1/2] percpu_counter: Allow falling back to global counter on large system

2016-03-19 Thread Christoph Lameter
On Wed, 16 Mar 2016, Waiman Long wrote: > > If the cpumask is empty you can use the global count. Otherwise you just > > need to add up the counters of the cpus set in the cpumask. > > > > I have modified the patch to try that out. However, that doesn't yield that > much of improvement in term of

Re: [RFC PATCH 1/2] percpu_counter: Allow falling back to global counter on large system

2016-03-07 Thread Waiman Long
On 03/07/2016 01:24 PM, Christoph Lameter wrote: On Fri, 4 Mar 2016, Waiman Long wrote: This patch provides a mechanism to selectively degenerate per-cpu counters to global counters at per-cpu counter initialization time. The following new API is added: percpu_counter_set_limit(struct percp

Re: [RFC PATCH 1/2] percpu_counter: Allow falling back to global counter on large system

2016-03-07 Thread Christoph Lameter
On Fri, 4 Mar 2016, Waiman Long wrote: > This patch provides a mechanism to selectively degenerate per-cpu > counters to global counters at per-cpu counter initialization time. The > following new API is added: > > percpu_counter_set_limit(struct percpu_counter *fbc, >

[RFC PATCH 1/2] percpu_counter: Allow falling back to global counter on large system

2016-03-04 Thread Waiman Long
Per-cpu counters are used in quite a number of places within the kernel. On large system with a lot of CPUs, however, doing a percpu_counter_sum() can be very expensive as nr_cpu cachelines will need to be read. In __percpu_counter_compare(), the chance of calling percpu_counter_sum() also increas