public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jan Beulich <JBeulich@novell.com>
Cc: "mingo@elte.hu" <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	Ky Srinivasan <KSrinivasan@novell.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>
Subject: Re: [PATCH 1/4, v2] x86: enlightenment for ticket spin locks -	 base implementation
Date: Wed, 30 Jun 2010 15:28:07 +0200	[thread overview]
Message-ID: <4C2B4667.9050103@goop.org> (raw)
In-Reply-To: <4C2B60FE0200007800008D3B@vpn.id2.novell.com>

On 06/30/2010 03:21 PM, Jan Beulich wrote:
>>>> On 30.06.10 at 14:53, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>>>>         
>> On 06/30/2010 01:52 PM, Jan Beulich wrote:
>>     
>>> I fail to see that: Depending on the hypervisor's capabilities, the
>>> two main functions could be much smaller (potentially there wouldn't
>>> even be a need for the unlock hook in some cases),
>>>       
>> What mechanism are you envisaging in that case?
>>     
> A simple yield is better than not doing anything at all.
>   

Is that true?  The main problem with ticket locks is that it requires
the host scheduler to schedule the correct "next" vcpu after unlock.  If
the vcpus are just bouncing in and out of the scheduler with yields then
there's still no guarantee that the host scheduler will pick the right
vcpu at anything like the right time.  I guess if a vcpu knows its next
it can plain spin while everyone else yields and that would work
approximately OK.

>>> The list really juts is needed to not pointlessly tickle CPUs that
>>> won't own the just released lock next anyway (or would own
>>> it, but meanwhile went for another one where they also decided
>>> to go into polling mode).
>>>       
>> Did you measure that it was a particularly common case which was worth
>> optimising for?
>>     
> I didn't measure this particular case. But since the main problem
> with ticket locks is when (host) CPUs are overcommitted, it
> certainly is a bad idea to create even more load on the host than
> there already is (the more that these are bursts).
>   

A directed wakeup is important, but I'm not sure how important its
efficiency is (since you're already deep in slowpath if it makes a
difference at all).

    J

  reply	other threads:[~2010-06-30 13:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 14:31 [PATCH 1/4, v2] x86: enlightenment for ticket spin locks - base implementation Jan Beulich
2010-06-30  8:05 ` Peter Zijlstra
2010-06-30  9:00   ` Jan Beulich
2010-06-30  9:11     ` Peter Zijlstra
2010-06-30  9:56       ` Jeremy Fitzhardinge
2010-06-30 11:43         ` Jan Beulich
2010-06-30 11:48           ` Peter Zijlstra
2010-06-30 11:54             ` Jan Beulich
2010-06-30 10:50       ` Jeremy Fitzhardinge
2010-06-30 11:52         ` Jan Beulich
2010-06-30 12:53           ` Jeremy Fitzhardinge
2010-06-30 13:21             ` Jan Beulich
2010-06-30 13:28               ` Jeremy Fitzhardinge [this message]
2010-06-30  9:26   ` Peter Zijlstra
2010-06-30  9:32     ` Gleb Natapov
2010-06-30  8:24 ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C2B4667.9050103@goop.org \
    --to=jeremy@goop.org \
    --cc=JBeulich@novell.com \
    --cc=KSrinivasan@novell.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox