On Thu, 03 Oct 2019 09:39:17 +0100
David Howells <dhowe...@redhat.com> wrote:

> paul...@kernel.org wrote:
> 
> > +#define rcu_replace(rcu_ptr, ptr, c)                                       
> > \
> > +({                                                                 \
> > +   typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c));  \
> > +   rcu_assign_pointer((rcu_ptr), (ptr));                           \
> > +   __tmp;                                                          \
> > +})  
> 
> Does it make sense to actually use xchg() if that's supported by the arch?
> 

Hmm, is there really any arch that doesn't support xchg()? It would be
very hard to do any kind of atomic operations without it.

cmpxchg() is the one that I understand is optional by the arch.

-- Steve

Reply via email to