public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Raghavendra KT <raghavendra.kt.linux@gmail.com>,
	Marc Zyngier <Marc.Zyngier@arm.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	Will Deacon <Will.Deacon@arm.com>,
	Raghavendra KT <raghavendra.kt@linux.vnet.ibm.com>
Subject: Re: [PATCH 3/4] arm64: KVM: let other tasks run when hitting WFE
Date: Tue, 23 Jul 2013 11:41:14 +0100	[thread overview]
Message-ID: <20130723104113.GE3748@MacBook-Pro.local> (raw)
In-Reply-To: <CAMJs5B8Sg1MPHPsRV75mmagnYxkhzA0MKWVkwW2y0WdDVWTSxQ@mail.gmail.com>

On Mon, Jul 22, 2013 at 01:51:52PM +0100, Christoffer Dall wrote:
> On 22 July 2013 10:53, Raghavendra KT <raghavendra.kt.linux@gmail.com> wrote:
> > On Fri, Jul 19, 2013 at 7:23 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> >> So far, when a guest executes WFE (like when waiting for a spinlock
> >> to become unlocked), we don't do a thing and let it run uninterrupted.
> >>
> >> Another option is to trap a blocking WFE and offer the opportunity
> >> to the scheduler to switch to another task, potentially giving the
> >> vcpu holding the spinlock a chance to run sooner.
> >>
> >
> > Idea looks to be correct from my experiments on x86. It does bring some
> > percentage of benefits in overcommitted guests. Infact,
> >
> > https://lkml.org/lkml/2013/7/22/41 tries to do the same thing for x86.
> > (this results in using ple handler heuristics in vcpu_block pach).
> 
> What about the adverse effect in the non-overcommitted case?

Could we not detect overcommitment and only set the TWE bit in this case
(per VCPU scheduled to run)?

The advantage of a properly para-virtualised lock is that you can target
which VCPU to wake up. I don't think we can do this currently (without
assumptions about the underlying OS and how the compiler allocates
registers in the ticket spinlocks).

There have been suggestions to use WFE in user-space for a more power
efficient busy loop (usually in user-only locking, I think some
PostreSQL does that) together with an automatic even stream for waking
up the WFE (Sudeep posted some patches recently for enabling 100us event
stream). If such feature gets used, we have a new meaning for WFE and we
may not want to trap it all the time.

Question for Will - do we have a PMU counter for WFE? (don't ask why ;))

-- 
Catalin

  parent reply	other threads:[~2013-07-23 10:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 13:53 [PATCH 0/4] KVM/arm64 fixes for 3.11 Marc Zyngier
2013-07-19 13:53 ` [PATCH 1/4] arm64: KVM: perform save/restore of PAR_EL1 Marc Zyngier
2013-07-20 21:51   ` Christoffer Dall
2013-07-19 13:53 ` [PATCH 2/4] arm64: KVM: add missing dsb before invalidating Stage-2 TLBs Marc Zyngier
2013-07-19 14:32   ` Will Deacon
2013-07-19 14:53     ` Marc Zyngier
2013-07-19 13:53 ` [PATCH 3/4] arm64: KVM: let other tasks run when hitting WFE Marc Zyngier
2013-07-19 14:25   ` Will Deacon
2013-07-19 14:29     ` Marc Zyngier
2013-07-20 22:04   ` Christoffer Dall
2013-07-22  7:36   ` Gleb Natapov
2013-07-22  8:53   ` Raghavendra KT
2013-07-22 12:51     ` Christoffer Dall
2013-07-22 13:01       ` Will Deacon
2013-07-22 13:57       ` Raghavendra K T
2013-07-28 20:55         ` Christoffer Dall
2013-07-29  7:35           ` Raghavendra K T
2013-07-23 10:41       ` Catalin Marinas [this message]
2013-07-23 16:04         ` Will Deacon
2013-07-19 13:53 ` [PATCH 4/4] arm64: KVM: remove __kvm_hyp_code_{start,end} from hyp.S Marc Zyngier
2013-07-22  7:36   ` Gleb Natapov

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=20130723104113.GE3748@MacBook-Pro.local \
    --to=catalin.marinas@arm.com \
    --cc=Marc.Zyngier@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=raghavendra.kt.linux@gmail.com \
    --cc=raghavendra.kt@linux.vnet.ibm.com \
    /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