[PATCH v3 16/21] arm64: percpu: Implement preemptible void RMW ops

David Laight david.laight.linux at gmail.com
Tue Sep 8 13:52:09 PDT 2026


On Tue, 8 Sep 2026 16:07:40 +0100
Mark Rutland <mark.rutland at arm.com> wrote:

> On Sat, Sep 05, 2026 at 10:03:19AM +0100, David Laight wrote:
> > On Fri,  4 Sep 2026 17:17:53 +0100
> > Mark Rutland <mark.rutland at arm.com> wrote:
> >   
> > > Use the PCPU GPR infrastructure to implement all of the RMW ops which do
> > > not return a value.  
> > ...  
> > >  #define __PERCPU_OP_CASE(w, sfx, name, sz, op_llsc, op_lse)		\  
> > 
> > Isn't this definition exactly the same as __PERCPU_RET_OP_CASE() except
> > for s/tmp/ret/ and the 'return ret'?  
> 
> Not exactly the same; the __PERCPU_RET_OP_CASE() assembly also performs
> an additional instruction at the end in order to generate the RETURN
> value.

I had missed that - it is only in the LSE atomics alternative.
However it also replaces a nop so wouldn't affect code size or
execution speed.

David

> 
> > Since the compiler will just ignore the unwanted return value
> > there is not point replicating the definition.  
> 
> We could consider sharing the assembly, but it's not quite that simple,
> so I'm going to leave this as-is for now.
> 
> Mark.
> 




More information about the linux-arm-kernel mailing list