[lkml]   [2008]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Hi Rusty,

I'm trying to make the ring buffers lockless and reentrant. It is slowly
going that way. The local_add_return is to reserve a part of the ring
buffer even when an interrupt can come in and reserver part of that same
ring buffer. The atomic add here has to only be atomic with respect to

On intel, there is no reason to use a LOCK increment, since the ring
buffers are per cpu. A simple asm inc would work. I was thinking that is
what local_add_return gives me. I could replace the local_add_returns with
atomic_add_return, but that just seems to be adding overhead for archs
that do not need it.

Shouldn't local_add_return be a way for archs that can increment a memory
location atomically against interrupts to use that infrastructure? It can
simply fall back to atomic_add_return for those archs that do not have
a lesser equivalent of atomic_add_return.

-- Steve

 \ /
  Last update: 2008-12-15 14:49    [W:0.073 / U:0.328 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site