[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aM05J6FU0xG3SBzR@andrea>
Date: Fri, 19 Sep 2025 13:06:15 +0200
From: Andrea Parri <parri.andrea@...il.com>
To: Xu Lu <luxu.kernel@...edance.com>
Cc: corbet@....net, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, paul.walmsley@...ive.com, palmer@...belt.com,
aou@...s.berkeley.edu, alex@...ti.fr, will@...nel.org,
peterz@...radead.org, boqun.feng@...il.com, mark.rutland@....com,
ajones@...tanamicro.com, brs@...osinc.com, anup@...infault.org,
atish.patra@...ux.dev, pbonzini@...hat.com, shuah@...nel.org,
devicetree@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org, apw@...onical.com, joe@...ches.com,
linux-doc@...r.kernel.org, kvm@...r.kernel.org,
kvm-riscv@...ts.infradead.org, linux-kselftest@...r.kernel.org
Subject: Re: [External] Re: [PATCH v3 0/8] riscv: Add Zalasr ISA extension
support
> > > (not a review, just looking at this diff stat) is changing the fastpath
> > >
> > > read_unlock()
> > > read_lock()
> > >
> > > from something like
> > >
> > > fence rw,w
> > > amodadd.w
> > > amoadd.w
> > > fence r,rw
> > >
> > > to
> > >
> > > fence rw,rw
> > > amoadd.w
> > > amoadd.w
> > > fence rw,rw
> > >
> > > no matter Zalasr or !Zalasr. Similarly for other atomic operations with
> > > release or acquire semantics. I guess the change was not intentional?
> > > If it was intentional, it should be properly mentioned in the changelog.
> >
> > Sorry about that. It is intended. The atomic operation before
> > __atomic_acquire_fence or operation after __atomic_release_fence can
> > be just a single ld or sd instruction instead of amocas or amoswap. In
> > such cases, when the store release operation becomes 'sd.rl', the
> > __atomic_acquire_fence via 'fence r, rw' can not ensure FENCE.TSO
> > anymore. Thus I replace it with 'fence rw, rw'.
But you could apply similar changes you performed for xchg & cmpxchg: use
.AQ and .RL for other atomic RMW operations as well, no? AFAICS, that is
what arm64 actually does in arch/arm64/include/asm/atomic_{ll_sc,lse}.h .
Andrea
> This is also the common implementation on other architectures who use
> aq/rl instructions like ARM. And you certainly already knew it~
Powered by blists - more mailing lists