Re: [RFC][PATCH 08/12] s390: Replace cmpxchg_double() with cmpxchg128()

From: Heiko Carstens
Date: Tue Jan 10 2023 - 02:24:47 EST


On Mon, Dec 19, 2022 at 04:35:33PM +0100, Peter Zijlstra wrote:
> In order to depricate cmpxchg_double(), replace all its usage with
> cmpxchg128().
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---
> arch/s390/include/asm/cpu_mf.h | 29 ++++++++++++-----
> arch/s390/kernel/perf_cpum_sf.c | 65 +++++++++++++++++++++++++---------------
> 2 files changed, 63 insertions(+), 31 deletions(-)

So, Alexander Gordeev reported that this code was already prior to your
changes potentially broken with respect to missing READ_ONCE() within the
cmpxchg_double() loops.

In order to fix that and have a patch that can be backported I would go
with something like the patch below, which I would also plan to send for
-rc4, unless there are objections.

This can then easily be converted to the new cmpxchg128() later.