From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Aili Yao <yaoaili@kingsoft.com>
Subject: Re: [PATCH RESEND v2] KVM: LAPIC: Enable timer posted-interrupt when mwait/hlt is advertised
Date: Tue, 1 Feb 2022 13:11:50 +0100 [thread overview]
Message-ID: <ae828eca-40bd-60f3-263f-5b3de637a9aa@redhat.com> (raw)
In-Reply-To: <1643112538-36743-1-git-send-email-wanpengli@tencent.com>
On 1/25/22 13:08, Wanpeng Li wrote:
> As commit 0c5f81dad46 (KVM: LAPIC: Inject timer interrupt via posted interrupt)
> mentioned that the host admin should well tune the guest setup, so that vCPUs
> are placed on isolated pCPUs, and with several pCPUs surplus for*busy* housekeeping.
> It is better to disable mwait/hlt/pause vmexits to keep the vCPUs in non-root
> mode. However, we may isolate pCPUs for other purpose like DPDK or we can make
> some guests isolated and others not, we may lose vmx preemption timer/timer fastpath
> due to not well tuned setup, and the checking in kvm_can_post_timer_interrupt()
> is not enough. Let's guarantee mwait/hlt is advertised before enabling posted-interrupt
> interrupt. vmx preemption timer/timer fastpath can continue to work if both of them
> are not advertised.
Is this the same thing that you meant?
--------
As commit 0c5f81dad46 ("KVM: LAPIC: Inject timer interrupt via posted interrupt")
mentioned that the host admin should well tune the guest setup, so that vCPUs
are placed on isolated pCPUs, and with several pCPUs surplus for *busy* housekeeping.
In this setup, it is preferrable to disable mwait/hlt/pause vmexits to
keep the vCPUs in non-root mode.
However, if only some guests isolated and others not, they would not have
any benefit from posted timer interrupts, and at the same time lose
VMX preemption timer fast paths because kvm_can_post_timer_interrupt()
returns true and therefore forces kvm_can_use_hv_timer() to false.
By guaranteeing that posted-interrupt timer is only used if MWAIT or HLT
are done without vmexit, KVM can make a better choice and use the
VMX preemption timer and the corresponding fast paths.
--------
Thanks,
Paolo
next prev parent reply other threads:[~2022-02-01 12:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 12:08 Wanpeng Li
2022-02-01 12:11 ` Paolo Bonzini [this message]
2022-02-01 13:57 ` Wanpeng Li
2022-02-01 17:19 ` Paolo Bonzini
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=ae828eca-40bd-60f3-263f-5b3de637a9aa@redhat.com \
--to=pbonzini@redhat.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=yaoaili@kingsoft.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
all inboxes | Powered by JetHome®