From: "Mi, Dapeng1" <dapeng1.mi@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>, "Christopherson,,
Sean" <seanjc@google.com>
Cc: "rafael@kernel.org" <rafael@kernel.org>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"zhenyuw@linux.intel.com" <zhenyuw@linux.intel.com>
Subject: RE: [PATCH] KVM: x86: use TPAUSE to replace PAUSE in halt polling
Date: Thu, 25 Aug 2022 12:16:06 +0000 [thread overview]
Message-ID: <PH0PR11MB48248A1C76F7F3538FD2AC30CD729@PH0PR11MB4824.namprd11.prod.outlook.com> (raw)
In-Reply-To: <f1598980-92a8-267c-cade-8f62d7653017@redhat.com>
> From: Paolo Bonzini <pbonzini@redhat.com>
> Sent: Thursday, August 25, 2022 1:19 AM
> To: Christopherson,, Sean <seanjc@google.com>; Mi, Dapeng1
> <dapeng1.mi@intel.com>
> Cc: rafael@kernel.org; daniel.lezcano@linaro.org; linux-pm@vger.kernel.org;
> linux-kernel@vger.kernel.org; kvm@vger.kernel.org; zhenyuw@linux.intel.com
> Subject: Re: [PATCH] KVM: x86: use TPAUSE to replace PAUSE in halt polling
>
> On 8/24/22 17:26, Sean Christopherson wrote:
> > I say "if", because I think this needs to come with performance
> > numbers to show the impact on guest latency so that KVM and its users can
> make an informed decision.
> > And if it's unlikely that anyone will ever want to enable TPAUSE for
> > halt polling, then it's not worth the extra complexity in KVM.
>
> Yeah, halt polling works around perhaps the biggest performance issue with VMs
> compared to bare metal (so much that it's even possible to move halt polling
> _inside_ the guest for extra performance).
>
> I am ready to be proven wrong but I doubt TPAUSE will have a small effect, and
> if one wants the most power saving they should disable halt polling. Perhaps
> KVM could do it automatically if the powersaving governor is in effect?
Paolo,
In our tests, we see halt polling consumes too much CPU resources and power. For example, In video playback case,
The CPU utilization of halt polling is 17% and brings 7% extra power consumption comparing with disabling halt polling.
Halt polling seems to consume too much cpu resource and power than imagine, especially for Client platform, it make things worse.
Base on our observation, TPAUSE could improve 1% ~ 2% power saving. Disabling halt polling is another alternative method we are thinking.
Base on our tests, we don't see there are obvious performance downgrade even for FIO and netperf on Intel Alderlake platform. It looks
the context switch latency could not be so large on the latest CPU.
Yes, you are right, it could be a better method to make KVM enable/disable halt polling base on the CPU performance governor.
>
> Paolo
next prev parent reply other threads:[~2022-08-25 12:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 9:11 Dapeng Mi
2022-08-24 14:08 ` David Laight
2022-08-25 11:08 ` Mi, Dapeng1
2022-08-24 15:26 ` Sean Christopherson
2022-08-24 17:19 ` Paolo Bonzini
2022-08-25 12:16 ` Mi, Dapeng1 [this message]
2022-08-25 11:31 ` Mi, Dapeng1
2022-08-26 10:14 ` Paolo Bonzini
2022-08-30 5:56 ` Mi, Dapeng1
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=PH0PR11MB48248A1C76F7F3538FD2AC30CD729@PH0PR11MB4824.namprd11.prod.outlook.com \
--to=dapeng1.mi@intel.com \
--cc=daniel.lezcano@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rafael@kernel.org \
--cc=seanjc@google.com \
--cc=zhenyuw@linux.intel.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®