kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH v3 0/4] KVM: LAPIC: Implement Exitless Timer
Date: Thu, 13 Jun 2019 10:59:22 +0300	[thread overview]
Message-ID: <a078b29ebc0a2323c89b5877bf2ba4005eef3485.camel@redhat.com> (raw)
In-Reply-To: <1560255429-7105-1-git-send-email-wanpengli@tencent.com>

On Tue, 2019-06-11 at 20:17 +0800, Wanpeng Li wrote:
> Dedicated instances are currently disturbed by unnecessary jitter due 
> to the emulated lapic timers fire on the same pCPUs which vCPUs resident.
> There is no hardware virtual timer on Intel for guest like ARM. Both 
> programming timer in guest and the emulated timer fires incur vmexits.
> This patchset tries to avoid vmexit which is incurred by the emulated 
> timer fires in dedicated instance scenario. 
> 
> When nohz_full is enabled in dedicated instances scenario, the unpinned 
> timer will be moved to the nearest busy housekeepers after commit 444969223c8
> ("sched/nohz: Fix affine unpinned timers mess"). However, KVM always makes 
> lapic timer pinned to the pCPU which vCPU residents, the reason is explained 
> by commit 61abdbe0 (kvm: x86: make lapic hrtimer pinned). Actually, these 
> emulated timers can be offload to the housekeeping cpus since APICv 
> is really common in recent years. The guest timer interrupt is injected by 
> posted-interrupt which is delivered by housekeeping cpu once the emulated 
> timer fires. 
> 
> The host admin should fine tuned, e.g. dedicated instances scenario w/ 
> nohz_full cover the pCPUs which vCPUs resident, several pCPUs surplus 
> for housekeeping, disable mwait/hlt/pause vmexits to occupy the pCPUs, 
> fortunately preemption timer is disabled after mwait is exposed to 
> guest which makes emulated timer offload can be possible. 
> ~3% redis performance benefit can be observed on Skylake server.

I don't yet know the kvm well enough to review this patch series, but overall I really like the idea.
I researched this area some time ago, to see what can be done to reduce the number of vmexits,
to an absolute minimum.

I have one small question, just out of curiosity.

Why do you require mwait in the guest to be enabled? 

If I understand it correctly, you say
that when mwait in the guest is disabled, then vmx preemption timer will be used,
and thus it will handle the apic timer?

Best regards,
	Maxim Levitsky


  parent reply	other threads:[~2019-06-13 16:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 12:17 [PATCH v3 0/4] KVM: LAPIC: Implement Exitless Timer Wanpeng Li
2019-06-11 12:17 ` [PATCH v3 1/4] KVM: LAPIC: Make lapic timer unpinned when timer is injected by pi Wanpeng Li
2019-06-11 20:39   ` Marcelo Tosatti
2019-06-12  0:45     ` Wanpeng Li
2019-06-12 16:15       ` Marcelo Tosatti
2019-06-11 12:17 ` [PATCH v3 2/4] KVM: LAPIC: lapic timer interrupt is injected by posted interrupt Wanpeng Li
2019-06-11 20:18   ` Marcelo Tosatti
2019-06-12  1:48     ` Wanpeng Li
2019-06-12 15:22       ` Radim Krčmář
2019-06-12 21:51         ` Marcelo Tosatti
2019-06-11 12:17 ` [PATCH v3 3/4] KVM: LAPIC: Ignore timer migration when lapic timer is injected by posted-interrupt Wanpeng Li
2019-06-11 12:17 ` [PATCH v3 4/4] KVM: LAPIC: add advance timer support to pi_inject_timer Wanpeng Li
2019-06-13  7:59 ` Maxim Levitsky [this message]
2019-06-13  8:25   ` [PATCH v3 0/4] KVM: LAPIC: Implement Exitless Timer Wanpeng Li
2019-06-13  9:49     ` Maxim Levitsky

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=a078b29ebc0a2323c89b5877bf2ba4005eef3485.camel@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.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;
as well as URLs for NNTP newsgroup(s).