Re: [PATCH net-next 19/19] rxrpc: Use RCU to access a peer's service connection tree

From: David Howells
Date: Thu Jun 30 2016 - 12:22:28 EST


Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> > + if (conn->proto.index_key < k.index_key)
> > + p = p->rb_left;
> > + else if (conn->proto.index_key > k.index_key)
> > + p = p->rb_right;
>
> You still very much need rcu_dereference() for both left and right
> pointers. As well as the first p load.

Bah... Yes. Good point.

> > + rb_link_node(&conn->service_node, parent, pp);
>
> You want rb_link_node_rcu() here.

Should there be an rb_replace_node_rcu() also?

David