Re: [PATCH] rwlock: remove unneeded subtraction

2022-02-15 Thread Roger Pau Monné
On Tue, Feb 15, 2022 at 03:45:00PM +0100, Jan Beulich wrote: > On 15.02.2022 15:16, Roger Pau Monné wrote: > > I could add to the commit message: > > > > "Originally _QR_BIAS was subtracted from the result of > > atomic_add_return_acquire in order to prevent GCC from emitting an > > unneeded ADD i

Re: [PATCH] rwlock: remove unneeded subtraction

2022-02-15 Thread Jan Beulich
On 15.02.2022 15:16, Roger Pau Monné wrote: > On Tue, Feb 15, 2022 at 02:22:02PM +0100, Jan Beulich wrote: >> On 15.02.2022 14:13, Julien Grall wrote: >>> On 15/02/2022 09:39, Roger Pau Monne wrote: There's no need to subtract _QR_BIAS from the lock value for storing in the local cnts var

Re: [PATCH] rwlock: remove unneeded subtraction

2022-02-15 Thread Roger Pau Monné
On Tue, Feb 15, 2022 at 02:22:02PM +0100, Jan Beulich wrote: > On 15.02.2022 14:13, Julien Grall wrote: > > On 15/02/2022 09:39, Roger Pau Monne wrote: > >> There's no need to subtract _QR_BIAS from the lock value for storing > >> in the local cnts variable in the read lock slow path: the users of

Re: [PATCH] rwlock: remove unneeded subtraction

2022-02-15 Thread Jan Beulich
On 15.02.2022 14:13, Julien Grall wrote: > On 15/02/2022 09:39, Roger Pau Monne wrote: >> There's no need to subtract _QR_BIAS from the lock value for storing >> in the local cnts variable in the read lock slow path: the users of >> the value in cnts only care about the writer-related bits and use

Re: [PATCH] rwlock: remove unneeded subtraction

2022-02-15 Thread Julien Grall
Hi, On 15/02/2022 09:39, Roger Pau Monne wrote: There's no need to subtract _QR_BIAS from the lock value for storing in the local cnts variable in the read lock slow path: the users of the value in cnts only care about the writer-related bits and use a mask to get the value. Note that further s

Re: [PATCH] rwlock: remove unneeded subtraction

2022-02-15 Thread Luca Fancellu
> On 15 Feb 2022, at 09:39, Roger Pau Monne wrote: > > There's no need to subtract _QR_BIAS from the lock value for storing > in the local cnts variable in the read lock slow path: the users of > the value in cnts only care about the writer-related bits and use a > mask to get the value. > >

Re: [PATCH] rwlock: remove unneeded subtraction

2022-02-15 Thread Jan Beulich
On 15.02.2022 10:39, Roger Pau Monne wrote: > There's no need to subtract _QR_BIAS from the lock value for storing > in the local cnts variable in the read lock slow path: the users of > the value in cnts only care about the writer-related bits and use a > mask to get the value. > > Note that furt

[PATCH] rwlock: remove unneeded subtraction

2022-02-15 Thread Roger Pau Monne
There's no need to subtract _QR_BIAS from the lock value for storing in the local cnts variable in the read lock slow path: the users of the value in cnts only care about the writer-related bits and use a mask to get the value. Note that further setting of cnts in rspin_until_writer_unlock already