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:	Tue, 7 Jul 2015 13:17:31 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Will Deacon <will.deacon@....com>
Cc:	Waiman Long <waiman.long@...com>, Ingo Molnar <mingo@...hat.com>,
	Arnd Bergmann <arnd@...db.de>,
	Thomas Gleixner <tglx@...utronix.de>,
	"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Scott J Norton <scott.norton@...com>,
	Douglas Hatch <doug.hatch@...com>
Subject: Re: [PATCH 2/4] locking/qrwlock: Reduce reader/writer to reader lock
 transfer latency

On Tue, Jul 07, 2015 at 10:17:11AM +0100, Will Deacon wrote:
> > > Thinking about it, can we kill _QW_WAITING altogether and set (cmpxchg
> > > from 0) wmode to _QW_LOCKED in the write_lock slowpath, polling (acquire)
> > > rmode until it hits zero?
> > 
> > No, this is how we make the lock fair so that an incoming streams of 
> > later readers won't block a writer from getting the lock.
> 
> But won't those readers effectively see that the lock is held for write
> (because we set wmode to _QW_LOCKED before the existing reader had drained)
> and therefore fall down the slow-path and get held up on the spinlock?

Yes, that's the entire point. Once there's a writer pending, new readers
should queue too.
--
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