Userspace RCU+rtth hack (was Re: [patch 3/3] radix-tree: RCU lockless readside)

Nick Piggin
2006-06-22T18:23:47Z

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]

Just out of interest, attached is my userspace RCU implementation
and RCU radix-tree concurrent tests for Andrew Morton's radix-tree
test harness.

The RCU implementation is only 100 lines. Awful performance, of
course, but I've stretched the rcu_read_lock/unlock over large
periods so that we can get full concurrency at the cost of a
bit of memory build up. And it still seems to catch use-after
RCU-freed errors pretty easily.

Question - our kernel's call_rcu implies a smp_wmb, right? Because
that did catch me out initially, because I initially had no barrier
to prevent the freeing of the object becoming visible before
removal of its last reference becoming visible (fixed by adding
smp_wmb() in my call_rcu).

Nick

[-- Attachment #2: rtth.tar.gz --]
[-- Type: application/x-gunzip, Size: 21868 bytes --]