On Thu, Oct 03, 2024 at 09:30:53AM -0400, Mathieu Desnoyers wrote:
[...]
> > > + /*
> > > +  * Use RCU dereference without lockdep checks, because
> > > +  * lockdep is not aware of HP guarantees.
> > > +  */
> > > + addr2 = rcu_access_pointer(*addr_p);    /* Load A */
> > 
> > Why rcu_access_pointer() instead of READ_ONCE()? Because you want to
> > mark the head of address dependency?
> 
> Yes, the intent here is to mark the address dependency and provide
> a publication guarantee similar to RCU pairing rcu_assign_pointer
> and rcu_dereference. Do you see any reason why READ_ONCE() would
> suffice here ?

READ_ONCE() also provides address dependencies. See the "DEPENDENCY
RELATIONS: data, addr, and ctrl" section in
tools/memory-model/Documentation/explanantion.txt.

Regards,
Boqun

> 
> Thanks,
> 
> Mathieu
> 

Reply via email to