Re: [PATCH v2 3/5] locking/arch: Wire up local_try_cmpxchg

2023-05-17 Thread Charlemagne Lasse
> +static __inline__ bool local_try_cmpxchg(local_t *l, long *old, long new) > +{ > + typeof(l->a.counter) *__old = (typeof(l->a.counter) *) old; > + return try_cmpxchg_local(&l->a.counter, __old, new); > +} > + This patch then causes following sparse errors: ./arch/x86/include/as

Re: [PATCH v2 3/5] locking/arch: Wire up local_try_cmpxchg

2023-04-12 Thread Peter Zijlstra
On Wed, Apr 12, 2023 at 03:37:50PM +0200, Uros Bizjak wrote: > On Wed, Apr 12, 2023 at 1:33 PM Peter Zijlstra wrote: > > > > On Wed, Apr 05, 2023 at 04:17:08PM +0200, Uros Bizjak wrote: > > > diff --git a/arch/powerpc/include/asm/local.h > > > b/arch/powerpc/include/asm/local.h > > > index bc4bd1

Re: [PATCH v2 3/5] locking/arch: Wire up local_try_cmpxchg

2023-04-12 Thread Uros Bizjak
On Wed, Apr 12, 2023 at 1:33 PM Peter Zijlstra wrote: > > On Wed, Apr 05, 2023 at 04:17:08PM +0200, Uros Bizjak wrote: > > diff --git a/arch/powerpc/include/asm/local.h > > b/arch/powerpc/include/asm/local.h > > index bc4bd19b7fc2..45492fb5bf22 100644 > > --- a/arch/powerpc/include/asm/local.h >

Re: [PATCH v2 3/5] locking/arch: Wire up local_try_cmpxchg

2023-04-12 Thread Peter Zijlstra
On Wed, Apr 05, 2023 at 04:17:08PM +0200, Uros Bizjak wrote: > diff --git a/arch/powerpc/include/asm/local.h > b/arch/powerpc/include/asm/local.h > index bc4bd19b7fc2..45492fb5bf22 100644 > --- a/arch/powerpc/include/asm/local.h > +++ b/arch/powerpc/include/asm/local.h > @@ -90,6 +90,17 @@ static

[PATCH v2 3/5] locking/arch: Wire up local_try_cmpxchg

2023-04-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg and local_cmpxchg using typed C wrappers that call their _local counterpart and provide additional checking of their input arguments. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Huacai Chen Cc: WANG Xuerui Cc: Jiaxun Ya