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:	Sun, 04 Apr 2010 09:06:04 -0600
From:	"Peter W. Morreale" <pmorreale@...ell.com>
To:	Rik van Riel <riel@...hat.com>
Cc:	rostedt@...dmis.org, Darren Hart <dvhltc@...ibm.com>,
	"lkml," <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Gregory Haskins <ghaskins@...ell.com>,
	Sven-Thorsten Dietrich <sdietrich@...ell.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Chris Mason <chris.mason@...cle.com>,
	john cooper <john.cooper@...rd-harmonic.com>
Subject: Re: RFC: Ideal Adaptive Spinning Conditions

On Sat, 2010-04-03 at 21:50 -0400, Rik van Riel wrote:
> On 03/31/2010 10:25 PM, Steven Rostedt wrote:
> > On Wed, 2010-03-31 at 19:13 -0700, Darren Hart wrote:
> >> Steven Rostedt wrote:
> >>> On Wed, 2010-03-31 at 16:21 -0700, Darren Hart wrote:
> >>>
> >>>> o What type of lock hold times do we expect to benefit?
> >>>
> >>> 0 (that's a zero) :-p
> >>>
> >>> I haven't seen your patches but you are not doing a heuristic approach,
> >>> are you? That is, do not "spin" hoping the lock will suddenly become
> >>> free. I was against that for -rt and I would be against that for futex
> >>> too.
> >>
> >> I'm not sure what you're getting at here. Adaptive spinning is indeed
> >> hoping the lock will become free while you are spinning and checking
> >> it's owner...
> >
> > I'm talking about the original idea people had of "lets spin for 50us
> > and hope it is unlocked before then", which I thought was not a good
> > idea.
> 
> Maybe not a good idea when running on bare metal, but it
> could be a big help when running virtualized.
> 
> A lock with a short hold time can, occasionally, have a
> very long hold time, when the VCPU holding the lock is
> preempted by the host/hypervisor.
> 
> An adaptive lock would spin-and-acquire if the lock holder
> is running, while turning into a sleep lock when the lock
> holder has been preempted.
> 

Which is precisely what the RT variant does.  Each iteration of the
'spin' loop verifies that the lock owner is on CPU.   If the owner is
not, all other tasks stop spinning and sleep.

So how does a timeout help in the VCPU case?  

Best,
-PWM





--
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