Subject: Re: [patch 2/4] net: Percpufy frequently used variables -- struct proto.memory_allocated

From: Eric Dumazet <[email-masked]>
Date: Fri, 27 Jan 2006 10:01:15 +0100

Ravikiran G Thirumalai a écrit :
> Change struct proto->memory_allocated to a batching per-CPU counter 
> (percpu_counter) from an atomic_t.  A batching counter is better than a 
> plain per-CPU counter as this field is read often.
> 
> Signed-off-by: Pravin B. Shelar <[email-masked]>
> Signed-off-by: Ravikiran Thirumalai <[email-masked]>
> Signed-off-by: Shai Fultheim <[email-masked]>
> 

Hello Ravikiran

I like this patch, but I'm not sure current percpu_counter fits the needs.

The percpu_counter_read() can return a value that is off by +-
FBC_BATCH*NR_CPUS, ie 2*(NR_CPUS^2) or 4*(NR_CPUS^2)

if NR_CPUS = 128, the 'error' from percpu_counter_read() is +- 32768

Is it acceptable ?

Thank you
Eric