[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1561575536.25880.10.camel@amazon.de>
Date: Wed, 26 Jun 2019 18:58:57 +0000
From: "Raslan, KarimAllah" <karahmed@...zon.de>
To: "tglx@...utronix.de" <tglx@...utronix.de>,
"boris.ostrovsky@...cle.com" <boris.ostrovsky@...cle.com>,
"joao.m.martins@...cle.com" <joao.m.martins@...cle.com>,
"konrad.wilk@...cle.com" <konrad.wilk@...cle.com>,
"ankur.a.arora@...cle.com" <ankur.a.arora@...cle.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"rkrcmar@...hat.com" <rkrcmar@...hat.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"kernellwp@...il.com" <kernellwp@...il.com>,
"mtosatti@...hat.com" <mtosatti@...hat.com>
Subject: Re: cputime takes cstate into consideration
On Wed, 2019-06-26 at 10:54 -0400, Konrad Rzeszutek Wilk wrote:
> On Wed, Jun 26, 2019 at 12:33:30PM +0200, Thomas Gleixner wrote:
> >
> > On Wed, 26 Jun 2019, Wanpeng Li wrote:
> > >
> > > After exposing mwait/monitor into kvm guest, the guest can make
> > > physical cpu enter deeper cstate through mwait instruction, however,
> > > the top command on host still observe 100% cpu utilization since qemu
> > > process is running even though guest who has the power management
> > > capability executes mwait. Actually we can observe the physical cpu
> > > has already enter deeper cstate by powertop on host. Could we take
> > > cstate into consideration when accounting cputime etc?
> >
> > If MWAIT can be used inside the guest then the host cannot distinguish
> > between execution and stuck in mwait.
> >
> > It'd need to poll the power monitoring MSRs on every occasion where the
> > accounting happens.
> >
> > This completely falls apart when you have zero exit guest. (think
> > NOHZ_FULL). Then you'd have to bring the guest out with an IPI to access
> > the per CPU MSRs.
> >
> > I assume a lot of people will be happy about all that :)
>
> There were some ideas that Ankur (CC-ed) mentioned to me of using the perf
> counters (in the host) to sample the guest and construct a better
> accounting idea of what the guest does. That way the dashboard
> from the host would not show 100% CPU utilization.
You can either use the UNHALTED cycles perf-counter or you can use MPERF/APERFÂ
MSRs for that. (sorry I got distracted and forgot to send the patch)
>
> But the patches that Marcelo posted (" cpuidle-haltpoll driver") in
> "solves" the problem for Linux. That is the guest wants awesome latency and
> one way was to expose MWAIT to the guest, or just tweak the guest to do the
> idling a bit different.
>
> Marcelo patches are all good for Linux, but Windows is still an issue.
>
> Ankur, would you be OK sharing some of your ideas?
> >
> >
> > Thanks,
> >
> > tglx
> >
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
Powered by blists - more mailing lists