Re: [PATCH] percpu_counter: Fix __percpu_counter_sum()

David Miller
2008-12-04T06:14:51Z

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Wed, 03 Dec 2008 21:24:36 +0100

> [PATCH] percpu_counter: Fix __percpu_counter_sum()
>
> This function should not write into percpu local storage,
> without proper locking, or some changes done on other cpus
> might be lost.
>
> Adding proper locking would need to use atomic
> operations in fast path and would be expensive.
>
> Results of __percpu_counter_sum() can be wrong, this is a
> known fact.
>
> We also dont need to acquire the lock, this gives
> no better results.
>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

Acked-by: David S. Miller <davem@davemloft.net>