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

From: Nick Piggin
Date: Thu Jun 22 2006 - 14:22:27 EST


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: rtth.tar.gz
Description: application/gunzip