Re: [PATCH 5/6] bitops: wrap non-atomic bitops with a transparent macro

From: Alexander Lobakin
Date: Tue Jun 07 2022 - 07:12:08 EST


From: Alexander Lobakin <alexandr.lobakin@xxxxxxxxx>
Date: Tue, 7 Jun 2022 12:57:18 +0200

> From: Mark Rutland <mark.rutland@xxxxxxx>
> Date: Mon, 6 Jun 2022 17:27:16 +0100
>
> > On Mon, Jun 06, 2022 at 01:49:06PM +0200, Alexander Lobakin wrote:
> > > In preparation for altering the non-atomic bitops with a macro, wrap
> > > them in a transparent definition. This requires prepending one more
> > > '_' to their names in order to be able to do that seamlessly.
> > > sparc32 already has the triple-underscored functions, so I had to
> > > rename them ('___' -> 'sp32_').
> >
> > Could we use an 'arch_' prefix here, like we do for the atomics, or is that
> > already overloaded?
>
> Yeah it is, for example, x86 has 'arch_' functions defined in its
> architecture headers[0] and at the same time uses generic
> instrumented '__' helpers[1], so on x86 both underscored and 'arch_'
> are defined and they are not the same.

Oh well, forgot to attach the links. Can be found at the bottom of
this mail.

> Same with those sparc32 triple-underscored, sparc32 at the same time
> uses generic non-instrumented, so it has underscored, 'arch_' and
> triple-underscored.
>
> In general, bitops are overloaded with tons of prefixes already :)
> I'm not really glad that I introduced one more level, but not that
> we have many options here.
>
> >
> > Thanks,
> > Mark.
> >
> > >
> > > Signed-off-by: Alexander Lobakin <alexandr.lobakin@xxxxxxxxx>
> > > ---
>
> [...]
>
> > > --
> > > 2.36.1
>
> Thanks,
> Olek

[0] https://elixir.bootlin.com/linux/v5.19-rc1/source/arch/x86/include/asm/bitops.h#L136
[1] https://elixir.bootlin.com/linux/v5.19-rc1/source/include/asm-generic/bitops/instrumented-non-atomic.h#L93

Thanks,
Olek