Re: [PATCH] locking/atomic: simplify non-atomic wrappers

From: Peter Zijlstra
Date: Wed Jul 28 2021 - 05:27:34 EST


On Wed, Jul 21, 2021 at 04:58:13PM +0100, Mark Rutland wrote:
> Since the non-atomic arch_*() bitops use plain accesses, they are
> implicitly instrumnted by the compiler, and we work around this in the
> instrumented wrappers to avoid double instrumentation.
>
> It's simpler to avoid the wrappers entirely, and use the preprocessor to
> alias the arch_*() bitops to their regular versions, removing the need
> for checks in the instrumented wrappers.
>
> Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx>
> Suggested-by: Marco Elver <elver@xxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> ---
> .../asm-generic/bitops/instrumented-non-atomic.h | 21 +++++++--------------
> include/asm-generic/bitops/non-atomic.h | 16 +++++++---------
> 2 files changed, 14 insertions(+), 23 deletions(-)
>
> Hi Peter,
>
> Are you happy to take this atop your queue/locking/core branch?
>

Will do, thanks!