lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <571A3444.3090703@hpe.com>
Date:	Fri, 22 Apr 2016 10:25:08 -0400
From:	Waiman Long <waiman.long@....com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	<torvalds@...ux-foundation.org>, <mingo@...nel.org>,
	<tglx@...utronix.de>, <will.deacon@....com>,
	<paulmck@...ux.vnet.ibm.com>, <boqun.feng@...il.com>,
	<fweisbec@...il.com>, <linux-kernel@...r.kernel.org>,
	<linux-arch@...r.kernel.org>, <rth@...ddle.net>,
	<vgupta@...opsys.com>, <linux@....linux.org.uk>,
	<egtvedt@...fundet.no>, <realmz6@...il.com>,
	<ysato@...rs.sourceforge.jp>, <rkuo@...eaurora.org>,
	<tony.luck@...el.com>, <geert@...ux-m68k.org>,
	<james.hogan@...tec.com>, <ralf@...ux-mips.org>,
	<dhowells@...hat.com>, <jejb@...isc-linux.org>,
	<mpe@...erman.id.au>, <schwidefsky@...ibm.com>, <dalias@...c.org>,
	<davem@...emloft.net>, <cmetcalf@...lanox.com>,
	<jcmvbkbc@...il.com>, <arnd@...db.de>, <dbueso@...e.de>,
	<fengguang.wu@...el.com>
Subject: Re: [RFC][PATCH 31/31] locking,qrwlock: Employ atomic_fetch_add_acquire()

On 04/22/2016 05:04 AM, Peter Zijlstra wrote:
> The only reason for the current code is to make GCC emit only the
> "LOCK XADD" instruction on x86 (and not do a pointless extra ADD on
> the result), do so nicer.
>
> Signed-off-by: Peter Zijlstra (Intel)<peterz@...radead.org>
> ---
>   kernel/locking/qrwlock.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/kernel/locking/qrwlock.c
> +++ b/kernel/locking/qrwlock.c
> @@ -93,7 +93,7 @@ void queued_read_lock_slowpath(struct qr
>   	 * that accesses can't leak upwards out of our subsequent critical
>   	 * section in the case that the lock is currently held for write.
>   	 */
> -	cnts = atomic_add_return_acquire(_QR_BIAS,&lock->cnts) - _QR_BIAS;
> +	cnts = atomic_fetch_add_acquire(_QR_BIAS,&lock->cnts);
>   	rspin_until_writer_unlock(lock, cnts);
>
>   	/*
>
>

Thanks for taking out this weirdness in the code.

Acked-by: Waiman Long <waiman.long@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ