Re: [PATCH 1/3] rcu: Introduce hlist_nulls variant of hlist
From: Paul E. McKenney <hidden>
Date: 2008-11-19 21:18:01
From: Paul E. McKenney <hidden>
Date: 2008-11-19 21:18:01
On Wed, Nov 19, 2008 at 04:53:47PM -0200, Arnaldo Carvalho de Melo wrote:
Em Wed, Nov 19, 2008 at 10:46:24AM -0800, Paul E. McKenney escreveu:quoted
For whatever it is worth, here is a more complete use case, on the off-chance that it becomes useful some time: retry: rcu_read_lock();retry: /* should be here, huh? */
Indeed! Either that or have an rcu_read_unlock() before the goto retry. Good catch! Thanx, Paul
quoted
hlist_nulls_for_each_entry_rcu(tpos, pos, head, hn_node) { if (!(curgen = still_valid(tpos))) goto retry; if (needs_deletion(tpos)) { spin_lock(&update_side_lock); if (still_valid(tpos) == curgen) hlist_nulls_del_init_rcu(pos); spin_unlock(&update_side_lock); } } rcu_read_unlock();- Arnaldo