Skip to contentSkip to conversation

x86: mis-named percpu_xchg_op() after switch to cmpxchg?

DISCUSSION Jan Beulich 2 participants 2 messages Feb 7, 2011

lore
Share & tools
lore
#0 lore raw

Other than its name implies, with the switch to use cmpxchg instead of xchg (commit 8270137a0d50507a5b40f880db636527045b8466) this macro is no longer suitable for accessing anything that may be written by other than the local CPU (i.e. anything but the various this_cpu accessors). Shouldn't it therefore get renamed to eg this_cpu_xchg_op()?

Jan

#1 lore raw
Quoted 5 lines · Jan Beulich

Other than its name implies, with the switch to use cmpxchg instead of xchg (commit 8270137a0d50507a5b40f880db636527045b8466) this macro is no longer suitable for accessing anything that may be written by other than the local CPU (i.e. anything but the various this_cpu accessors). Shouldn't it therefore get renamed to eg this_cpu_xchg_op()?

No. The intend of the percpu_xchg_op was also to provide local cpu only semantics. percpu_xx operations in general have the same semantics as this_cpu operations.