From: Wanpeng Li <kernellwp@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Marcelo Tosatti <mtosatti@redhat.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
KarimAllah <karahmed@amazon.de>,
Vincent Guittot <vincent.guittot@linaro.org>,
Ingo Molnar <mingo@kernel.org>,
Ankur Arora <ankur.a.arora@oracle.com>,
christopher.s.hall@intel.com, hubert.chrzaniuk@intel.com,
Len Brown <len.brown@intel.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH RFC] sched/fair: Penalty the cfs task which executes mwait/hlt
Date: Tue, 14 Jan 2020 18:53:19 +0800 [thread overview]
Message-ID: <CANRm+Cz10Spq1mjBBa+RvgeUtNvWEXSfPzHy49gZbD-Z8+fh2A@mail.gmail.com> (raw)
In-Reply-To: <20200113123558.GF2827@hirez.programming.kicks-ass.net>
On Mon, 13 Jan 2020 at 20:36, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Mon, Jan 13, 2020 at 12:52:20PM +0100, Paolo Bonzini wrote:
> > On 13/01/20 11:43, Peter Zijlstra wrote:
> > > So the very first thing we need to get sorted is that MPERF/TSC ratio
> > > thing. TurboStat does it, but has 'funny' hacks on like:
> > >
> > > b2b34dfe4d9a ("tools/power turbostat: KNL workaround for %Busy and Avg_MHz")
> > >
> > > and I imagine that there's going to be more exceptions there. You're
> > > basically going to have to get both Intel and AMD to commit to this.
> > >
> > > IFF we can get concensus on MPERF/TSC, then yes, that is a reasonable
> > > way to detect a VCPU being idle I suppose. I've added a bunch of people
> > > who seem to know about this.
> > >
> > > Anyone, what will it take to get MPERF/TSC 'working' ?
> >
> > Do we really need MPERF/TSC for this use case, or can we just track
> > APERF as well and do MPERF/APERF to compute the "non-idle" time?
>
> So MPERF runs at fixed frequency (when !IDLE and typically the same
> frequency as TSC), APERF runs at variable frequency (when !IDLE)
> depending on DVFS state.
>
> So APERF/MPERF gives the effective frequency of the core, but since both
> stop during IDLE, it will not be a good indication of IDLE.
>
> Otoh, TSC doesn't stop in idle (.oO this depends on
> X86_FEATURE_CONSTANT_TSC) and therefore the MPERF/TSC ratio gives how
> much !idle time there was between readings.
Do you have a better solution to penalty vCPU process which mwait/hlt
executed inside? :)
Wanpeng
prev parent reply other threads:[~2020-01-14 10:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 1:50 [PATCH RFC] sched/fair: Penalty the cfs task which executes mwait/hlt Wanpeng Li
2020-01-08 15:50 ` Peter Zijlstra
2020-01-08 17:14 ` Paolo Bonzini
2020-01-09 11:53 ` Wanpeng Li
2020-01-13 10:43 ` Peter Zijlstra
2020-01-13 11:18 ` Rafael J. Wysocki
2020-01-13 12:29 ` Peter Zijlstra
2020-01-14 22:46 ` Rafael J. Wysocki
2020-01-13 11:52 ` Paolo Bonzini
2020-01-13 12:35 ` Peter Zijlstra
2020-01-14 10:53 ` Wanpeng Li [this message]
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=CANRm+Cz10Spq1mjBBa+RvgeUtNvWEXSfPzHy49gZbD-Z8+fh2A@mail.gmail.com \
--to=kernellwp@gmail.com \
--cc=ankur.a.arora@oracle.com \
--cc=christopher.s.hall@intel.com \
--cc=hubert.chrzaniuk@intel.com \
--cc=karahmed@amazon.de \
--cc=konrad.wilk@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=vincent.guittot@linaro.org \
/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).