linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	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>
Subject: Re: [PATCH RFC] sched/fair: Penalty the cfs task which executes mwait/hlt
Date: Wed, 8 Jan 2020 16:50:40 +0100	[thread overview]
Message-ID: <20200108155040.GB2827@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1578448201-28218-1-git-send-email-wanpengli@tencent.com>

On Wed, Jan 08, 2020 at 09:50:01AM +0800, Wanpeng Li wrote:
> From: Wanpeng Li <wanpengli@tencent.com>
> 
> To deliver all of the resources of a server to instances in cloud, there are no 
> housekeeping cpus reserved. libvirtd, qemu main loop, kthreads, and other agent/tools 
> etc which can't be offloaded to other hardware like smart nic, these stuff will 
> contend with vCPUs even if MWAIT/HLT instructions executed in the guest.
> 
> The is no trap and yield the pCPU after we expose mwait/hlt to the guest [1][2],
> 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.
> 
> For virtualization, there is a HLT activity state in CPU VMCS field which indicates 
> the logical processor is inactive because it executed the HLT instruction, but 
> SDM 24.4.2 mentioned that execution of the MWAIT instruction may put a logical 
> processor into an inactive state, however, this VMCS field never reflects this 
> state.

So far I think I can follow, however it does not explain who consumes
this VMCS state if it is set and how that helps. Also, this:

> This patch avoids fine granularity intercept and reschedule vCPU if MWAIT/HLT
> instructions executed, because it can worse the message-passing workloads which 
> will switch between idle and running frequently in the guest. Lets penalty the 
> vCPU which is long idle through tick-based sampling and preemption.

is just complete gibberish. And I have no idea what problem you're
trying to solve how.

Also, I don't think the TSC/MPERF ratio is architected, we can't assume
this is true for everything that has APERFMPERF.

/me tries to reconstruct intent from patch

So what you're doing is, mark the CPU 'idle' when the MPERF/TSC ratio <
1%, and then frob the vruntime such that it will hopefully preempt.
That's pretty disgusting.

Please, write a coherent problem statement and justify the magic
choices. This is unreviewable.

  reply	other threads:[~2020-01-08 15:50 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 [this message]
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

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=20200108155040.GB2827@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ankur.a.arora@oracle.com \
    --cc=karahmed@amazon.de \
    --cc=kernellwp@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --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).