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]
Date:	Mon, 3 Aug 2015 13:33:31 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Vineet Gupta <Vineet.Gupta1@...opsys.com>
Cc:	lkml <linux-kernel@...r.kernel.org>, arc-linux-dev@...opsys.com
Subject: Re: [PATCH 4/6] ARC: LLOCK/SCOND based rwlock

On Mon, Aug 03, 2015 at 03:33:06PM +0530, Vineet Gupta wrote:
> With LLOCK/SCOND, the rwlock counter can be atomically updated w/o need
> for a guarding spin lock.

Maybe re-iterate the exclusive vs shared spin story again.

And aside from the far too many full barriers (again), I was just
wondering about:

> +static inline void arch_write_unlock(arch_rwlock_t *rw)
> +{
> +	unsigned int val;
> +
> +	smp_mb();
> +
> +	/*
> +	 * rw->counter = __ARCH_RW_LOCK_UNLOCKED__;
> +	 */
> +	__asm__ __volatile__(
> +	"1:	llock	%[val], [%[rwlock]]	\n"
> +	"	scond	%[UNLOCKED], [%[rwlock]]\n"
> +	"	bnz	1b			\n"
> +	"					\n"
> +	: [val]		"=&r"	(val)
> +	: [rwlock]	"r"	(&(rw->counter)),
> +	  [UNLOCKED]	"r"	(__ARCH_RW_LOCK_UNLOCKED__)
> +	: "memory", "cc");
> +
> +	smp_mb();
> +}

Why can't that be a straight store?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ