On Wed, Apr 15, 2020 at 06:00:34PM +0200, Sebastian Andrzej Siewior wrote: > 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; Acked-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx> I'll resend this with a rewrite of your 1/3 based on the lates tdiscussions. For your 2/3, let us hold off on that for now as my rewrite of 1/3 will require rewriting your 2/3. thanks, - Joel > + krcp->bcached = NULL; > if (!bnode) { > WARN_ON_ONCE(sizeof(struct kfree_rcu_bulk_data) > PAGE_SIZE); > > -- > 2.26.0 >