Re: [patch 2/4] net: percpufy frequently used vars -- struct proto.memory_allocated

2006-03-08 Thread Ravikiran G Thirumalai
On Tue, Mar 07, 2006 at 07:22:34PM -0800, Andrew Morton wrote: > Ravikiran G Thirumalai <[EMAIL PROTECTED]> wrote: > > > > The problem is percpu_counter_sum has to read all the cpus cachelines. If > > we have to use percpu_counter_sum everywhere, then might as well use plain > > per-cpu counters

Re: [patch 2/4] net: percpufy frequently used vars -- struct proto.memory_allocated

2006-03-07 Thread Andrew Morton
Ravikiran G Thirumalai <[EMAIL PROTECTED]> wrote: > > On Tue, Mar 07, 2006 at 06:14:22PM -0800, Andrew Morton wrote: > > Ravikiran G Thirumalai <[EMAIL PROTECTED]> wrote: > > > > > > - if (atomic_read(sk->sk_prot->memory_allocated) < > > > sk->sk_prot->sysctl_mem[0]) { > > > +if (percpu_c

Re: [patch 2/4] net: percpufy frequently used vars -- struct proto.memory_allocated

2006-03-07 Thread Ravikiran G Thirumalai
On Tue, Mar 07, 2006 at 06:14:22PM -0800, Andrew Morton wrote: > Ravikiran G Thirumalai <[EMAIL PROTECTED]> wrote: > > > > - if (atomic_read(sk->sk_prot->memory_allocated) < > > sk->sk_prot->sysctl_mem[0]) { > > + if (percpu_counter_read(sk->sk_prot->memory_allocated) < > > +

Re: [patch 2/4] net: percpufy frequently used vars -- struct proto.memory_allocated

2006-03-07 Thread Andrew Morton
Ravikiran G Thirumalai <[EMAIL PROTECTED]> wrote: > > - if (atomic_read(sk->sk_prot->memory_allocated) < > sk->sk_prot->sysctl_mem[0]) { > +if (percpu_counter_read(sk->sk_prot->memory_allocated) < > +sk->sk_prot->sysctl_mem[0]) { Bear in mind that percpu_counter_read

[patch 2/4] net: percpufy frequently used vars -- struct proto.memory_allocated

2006-03-07 Thread Ravikiran G Thirumalai
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 PROTECTED]> Signed-off-by: Ravikiran Thirumalai <[EMAIL PROTECTED