From: Oliver Upton <oliver.upton@linux.dev>
To: "sundongxu (A)" <sundongxu3@huawei.com>
Cc: Marc Zyngier <maz@kernel.org>,
yuzenghui@huawei.com, james.morse@arm.com,
suzuki.poulose@arm.com, will@kernel.org, catalin.marinas@arm.com,
wanghaibin.wang@huawei.com, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, jiangkunkun@huawei.com
Subject: Re: [bug report] GICv4.1: VM performance degradation due to not trapping vCPU WFI
Date: Wed, 17 Jan 2024 17:50:28 +0100 [thread overview]
Message-ID: <ZagFVNsA1aLuxorp@linux.dev> (raw)
In-Reply-To: <89fe1503-6d62-90ca-5edb-e11c74846a00@huawei.com>
On Wed, Jan 17, 2024 at 10:20:32PM +0800, sundongxu (A) wrote:
> On 2024/1/16 19:13, Marc Zyngier wrote:
> > On Tue, 16 Jan 2024 03:26:08 +0000, "sundongxu (A)" <sundongxu3@huawei.com> wrote:
> >> We found a problem about GICv4/4.1, for example:
> >> We use QEMU to start a VM (4 vCPUs and 8G memory), VM disk was
> >> configured with virtio, and the network is configured with vhost-net,
> >> the CPU affinity of the vCPU and emulator is as follows, in VM xml:
<snip>
> >> <cputune>
> >> <vcpupin vcpu='0' cpuset='4'/>
> >> <vcpupin vcpu='1' cpuset='5'/>
> >> <vcpupin vcpu='2' cpuset='6'/>
> >> <vcpupin vcpu='3' cpuset='7'/>
> >> <emulatorpin cpuset='4,5,6,7'/>
> >> </cputune>
</snip>
> > Effectively, we apply the same principle to vSGIs as to vLPIs, and it
> > was found that this heuristic was pretty beneficial to vLPIs. I'm a
> > bit surprised that vSGIs are so different in their usage pattern.
>
> IMO, the point is hypervisor not trapping vCPU WFI, rather than
> vSGI/vLPI usage pattern.
Sure, that's what's affecting your use case, but the logic in the kernel
came about because improving virtual interrupt injection has been found
to be generally useful.
> >
> > Does it help if you move your "emulatorpin" to some other physical
> > CPUs?
>
> Yes,it does, in kernel 5.10 or 6.5rc1.
Won't your VM have a poor experience in this configuration regardless of WFx
traps? The value of vCPU pinning is to *isolate* the vCPU threads from
noise/overheads of the host and scheduler latencies. Seems to me that
VMM overhead threads are being forced to take time away from the guest.
Nevertheless, disabling WFI traps isn't going to work well for
overcommitted scenarios. The thought of tacking on more hacks in KVM has be
a bit uneasy, perhaps instead we can give userspace an interface to explicitly
enable/disable WFx traps and let it pick a suitable policy.
--
Thanks,
Oliver
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-01-17 16:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 3:26 [bug report] GICv4.1: VM performance degradation due to not trapping vCPU WFI sundongxu (A)
2024-01-16 11:13 ` Marc Zyngier
2024-01-17 14:20 ` sundongxu (A)
2024-01-17 16:50 ` Oliver Upton [this message]
2024-01-18 7:56 ` sundongxu (A)
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=ZagFVNsA1aLuxorp@linux.dev \
--to=oliver.upton@linux.dev \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=jiangkunkun@huawei.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=sundongxu3@huawei.com \
--cc=suzuki.poulose@arm.com \
--cc=wanghaibin.wang@huawei.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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).