There is no need to use xchg(), the access is serialized by krcp->lock. The xchg() function adds some atomic barriers which remain hidden in x86's disassembly but are visible on ARM for instance. Replace xchg() with a load + store. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> --- kernel/rcu/tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index b31b61721a9ff..04d11c49ff3b9 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3079,7 +3079,8 @@ kfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu *krcp, /* Check if a new block is required. */ if (!krcp->bhead || krcp->bhead->nr_records == KFREE_BULK_MAX_ENTR) { - bnode = xchg(&krcp->bcached, NULL); + bnode = krcp->bcached; + krcp->bcached = NULL; if (!bnode) { WARN_ON_ONCE(sizeof(struct kfree_rcu_bulk_data) > PAGE_SIZE); -- 2.26.0