Memory allocation performance

Alexander Motin mav at FreeBSD.org
Sat Feb 2 11:56:44 PST 2008


Peter Jeremy пишет:
> On Sat, Feb 02, 2008 at 11:31:31AM +0200, Alexander Motin wrote:
>> To check UMA dependency I have made a trivial one-element cache which in my 
>> test case allows to avoid two for four allocations per packet.
> 
> You should be able to implement this lockless using atomic(9).  I haven't
> verified it, but the following should work.

I have tried this, but man 9 atomic talks:

The atomic_readandclear() functions are not implemented for the types
``char'', ``short'', ``ptr'', ``8'', and ``16'' and do not have any 
variants with memory barriers at this time.

-- 
Alexander Motin


More information about the freebsd-performance mailing list