Messages in this thread | | | Date | Tue, 7 Mar 2006 18:14:22 -0800 | From | Andrew Morton <> | Subject | Re: [patch 2/4] net: percpufy frequently used vars -- struct proto.memory_allocated |
| |
Ravikiran G Thirumalai <kiran@scalex86.org> 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[_positive] can be inaccurate on large CPU counts.
It might be worth running percpu_counter_sum() to get the exact count if we think we're about to cause something to fail.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |