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] [day] [month] [year] [list]
Date:	Fri, 1 Apr 2016 21:53:29 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Will Deacon <will.deacon@....com>
Cc:	Waiman Long <waiman.long@....com>, Ingo Molnar <mingo@...hat.com>,
	linux-kernel@...r.kernel.org,
	Scott J Norton <scott.norton@....com>,
	Douglas Hatch <doug.hatch@....com>
Subject: Re: [PATCH] locking/qrwlock: Allow multiple spinning readers

On Fri, Apr 01, 2016 at 05:47:43PM +0100, Will Deacon wrote:
> > +#define smp_cond_load_acquire(ptr, cond_expr)	({		\
> > +	typeof(ptr) __PTR = (ptr);				\
> > +	typeof(*ptr) VAL;					\
> 
> It's a bit grim having a magic variable name, but I have no better
> suggestion.

Right; we had this discussion and this is the best we could come up
with.

lkml.kernel.org/r/CA+55aFzZA9EB3hFptSpdmeMOifeM5BWQGOW+ib7SLvyMTETzaA@...l.gmail.com

> > +	for (;;) {						\
> > +		VAL = READ_ONCE(*__PTR);			\
> > +		if (cond_expr)					\
> > +			break;					\
> > +		cpu_relax();					\
> > +	}							\
> > +	smp_rmb(); /* ctrl + rmb := acquire */			\
> > +	VAL;							\
> > +})
> 
> Can you stick some #ifndef guards around this, please?

Oh sure; I'll even compile and boot it when I find a moment ;-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ