lkml.org 
[lkml]   [2019]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH tip/core/rcu 1/9] rcu: Upgrade rcu_swap_protected() to rcu_replace()
Date
paulmck@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?

David

\
 
 \ /
  Last update: 2019-10-03 10:40    [W:0.257 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site