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[_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 netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to