[ltt-dev] [RFC] Lock-free RCU queue for userspace RCU library

Paolo Bonzini pbonzini at redhat.com
Tue Jul 13 12:00:02 EDT 2010


On 07/12/2010 06:32 AM, Mathieu Desnoyers wrote:
> So, I think I found a neat way to handle lock-free rcu queues with
> reference counting instead. Note that the "dummy" node is really
> needed, otherwise we end up in situations where the "empty" queue is
> hard to deal with racelessly. FYI, the ABA problem is dealt with by
> using rcu read locks. Comments on the code below are very welcome.

There is a problem with reference counting: the neat part of my 
implementation was that I only needed to do a grace period after a few 
thousands allocations.  As it is now, the implementation of urcu_ref.h 
would synchronize on every allocation, which obviously kills performance.

So, maybe a page-slicing allocator can be bundled with URCU that layers 
my technique on top of some other allocator.  Being on vacation I won't 
do that for a couple of weeks, but I can do that if there is interest.

Otherwise, it looks great.

Paolo




More information about the lttng-dev mailing list