On Tue, Mar 30, 2010 at 05:37:49PM +0100, David Howells wrote:
The main criterion is that you have to have done something to prevent
the data structure from changing, which normally only happens on the
update side.
Indeed, that is rather ugly.
Hmmm... That sounds like something that checks the pointer for
correct format or for pointing to valid data.
What we are doing is dereferencing an RCU-protected pointer that we
are somehow preventing from being concurrently updated, usually by
holding the update-side lock.
So maybe rcu_dereference_no_updates()? Or rcu_dereference_locked()?
But not rcu_dereference_with_concurrent_updates_somehow_prevented(). ;-)
This would work for the moment, but I do not believe that sparse can
deal with tracking rcu_write_lock() across compilation units. Besides, I
really really don't want anything that looks like it is somehow protecting
the update. Too many newcomers to RCU somehow get the impression that
rcu_assign_pointer() provides that protection as it is. :-/
Indeed, the API explosion might be a bit unpleasant. ;-)
So, how about rcu_dereference_locked()?
Given that I worked quite happily with RCU for quite some time without
any words for any of the underlying concepts, I cannot claim that I
don't need at least some help with name selection. ;-)
Thanx, Paul
--