From: Sean Christopherson <seanjc@google.com>
To: zhenwei pi <pizhenwei@bytedance.com>
Cc: Wanpeng Li <kernellwp@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Jonathan Corbet <corbet@lwn.net>,
Wanpeng Li <wanpengli@tencent.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-doc@vger.kernel.org
Subject: Re: [PATCH] x86/kvm: Introduce boot parameter no-kvm-pvipi
Date: Tue, 26 Oct 2021 16:04:28 +0000 [thread overview]
Message-ID: <YXgnDBOXh2v3gzU4@google.com> (raw)
In-Reply-To: <ec014e8d-eb5f-03cc-3ed1-da58039ef034@bytedance.com>
On Mon, Oct 25, 2021, zhenwei pi wrote:
> Hi, Wanpeng & Sean
>
> Also benchmark redis(by 127.0.0.1) in a guest(2vCPU), 'no-kvm-pvipi' gets
> better performance.
>
> Test env:
> Host side: pin 2vCPU on 2core in a die.
> Guest side: run command:
> taskset -c 1 ./redis-server --appendonly no
> taskset -c 0 ./redis-benchmark -h 127.0.0.1 -d 1024 -n 10000000 -t get
>
> 1> without no-kvm-pvipi:
> redis QPS: 193203.12 requests per second
> kvm_pv_send_ipi exit: ~18K/s
>
> 2> with no-kvm-pvipi:
> redis QPS: 196028.47 requests per second
> avic_incomplete_ipi_interception exit: ~5K/s
Numbers look sane, but I don't think that adding a guest-side kernel param is
the correct "fix". As evidenced by Wanpeng's tests, PV IPI can outperform AVIC
in overcommit scenarios, and there's also no guarantee that AVIC/APICv is even
supported/enabled. In other words, blindly disabling PV IPIs from within the
guest makes sense if and only if the guest knows that AVIC is enabled and that
its vCPUs are pinned. If the guest has that info, then the host also has that
info, in which case the correct way to handle this is to simply not advertise
KVM_FEATURE_PV_SEND_IPI to the guest in CPUID.
next prev parent reply other threads:[~2021-10-26 16:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 12:07 [PATCH] x86/kvm: Introduce boot parameter no-kvm-pvipi zhenwei pi
2021-10-20 12:22 ` Wanpeng Li
2021-10-20 20:12 ` Sean Christopherson
2021-10-21 3:02 ` zhenwei pi
2021-10-21 5:03 ` Wanpeng Li
2021-10-21 7:17 ` zhenwei pi
2021-10-25 3:14 ` zhenwei pi
2021-10-26 16:04 ` Sean Christopherson [this message]
2021-10-27 0:46 ` Wanpeng Li
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=YXgnDBOXh2v3gzU4@google.com \
--to=seanjc@google.com \
--cc=corbet@lwn.net \
--cc=kernellwp@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=pizhenwei@bytedance.com \
--cc=wanpengli@tencent.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).