Andrew Morton a écrit : > Eric Dumazet wrote: >>> An advantage of retaining a spinlock in percpu_counter is that if accuracy >>> is needed at a low rate (say, /proc reading) we can take the lock and then >>> go spill each CPU's local count into the main one. It would need to be a >>> very low rate though. Or we make the cpu-local counters atomic too. >> We might use atomic_long_t only (and no spinlocks) > > Yup, that's it. > >> Something like this ? >> > > It'd be a lot neater if we had atomic_long_xchg(). You are my guest :) [PATCH] Add atomic_long_xchg() and atomic_long_cmpxchg() wrappers Signed-off-by: Eric Dumazet