On Wed, 2010-10-20 at 10:17 +1100, Dave Chinner wrote:
Correct, what can be made to work is combine RCU with a seqlock. Retry
the lookup using read_seqretry(), RCU here helps to ensure you're not
stepping on already freed memory.
So, tree modification does:
write_seqlock();
/* frob RB-tree, using call_rcu() for frees where needed */
write_sequnlock();
Lookup does:
unsigned seq;
rcu_read_lock()
again;
seq = read_seqbegin();
/* RB-tree lookup */
if (read_seqretry(seq))
goto again;
rcu_read_unlock();
return obj;
--