Re: [PATCH 28/33] locking/atomic: riscv: move to ARCH_ATOMIC

From: Mark Rutland
Date: Mon May 24 2021 - 08:10:49 EST


On Sat, May 22, 2021 at 12:02:45PM -0700, Palmer Dabbelt wrote:
> On Mon, 10 May 2021 02:37:48 PDT (-0700), mark.rutland@xxxxxxx wrote:
> > We'd like all architectures to convert to ARCH_ATOMIC, as once all
> > architectures are converted it will be possible to make significant
> > cleanups to the atomics headers, and this will make it much easier to
> > generically enable atomic functionality (e.g. debug logic in the
> > instrumented wrappers).
> >
> > As a step towards that, this patch migrates riscv to ARCH_ATOMIC. The
> > arch code provides arch_{atomic,atomic64,xchg,cmpxchg}*(), and common
> > code wraps these with optional instrumentation to provide the regular
> > functions.
> >
> > Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx>
> > Cc: Albert Ou <aou@xxxxxxxxxxxxxxxxx>
> > Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
> > Cc: Palmer Dabbelt <palmer@xxxxxxxxxxx>
> > Cc: Paul Walmsley <paul.walmsley@xxxxxxxxxx>
> > Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > Cc: Will Deacon <will@xxxxxxxxxx>
> > ---
> > arch/riscv/Kconfig | 1 +
> > arch/riscv/include/asm/atomic.h | 128 +++++++++++++++++++--------------------
> > arch/riscv/include/asm/cmpxchg.h | 34 +++++------
> > 3 files changed, 82 insertions(+), 81 deletions(-)

[...]

> Reviewed-by: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>
> Acked-by: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>

Thanks!

> Sorry this took a bit, I had this put on the slow queue because I thought it
> would conflict with Guo's patch set but from reading the rest of that thread
> it appears this is just supersedes which makes things much simpler.
>
> I'm assuming this would be for 5.14, and you'd be merging it along with the
> prep work?

Yup; the plan is to take the whole series through the tip tree for
v5.14.

I'll post a v2 soon with some minor fixups.

> I don't think we have anything else in the works that would
> require atomic changes for 5.14 yet so that seems OK for now, but it'd be
> nice to have some shared tag I could pull in both so I can test this and in
> case we have more to put on top of it. I'm fine waiting until something
> comes up if that's a headache on your end, though.

I think we can arrange a stable tag soon.

The Kbuild test robot is still finding a few edge cases with the
preprocessor glue on a few architectures, so my branch isn't stable yet,
but I think the core bit is solid, so if you wanted to test you should
be able to fetch my branch from:

git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git atomics/arch-atomic

Thanks,
Mark.