public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	juri.lelli@redhat.com, vincent.guittot@linaro.org,
	rohit.k.jain@oracle.com, dietmar.eggemann@arm.com,
	Steven Rostedt <rostedt@goodmis.org>,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
	vschneid@redhat.com, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Regression on vcpu_is_preempted()
Date: Sat, 29 Oct 2022 14:23:24 +0200	[thread overview]
Message-ID: <Y10bPHJh7g+4OW4k@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <d00f7b30-4b34-3d3d-98c5-d0db1a5d9c4f@huawei.com>

On Sat, Oct 29, 2022 at 05:15:15PM +0800, Miaohe Lin wrote:
> On 2022/10/29 16:58, Peter Zijlstra wrote:
> > On Fri, Oct 28, 2022 at 04:48:21PM +0800, Miaohe Lin wrote:
> >>   When scheduler tries to select a CPU to run the gc thread,
> >>   available_idle_cpu() will check whether vcpu_is_preempted().  It
> >>   will choose other vcpu to run gc threads when the current vcpu is
> >>   preempted. But the preempted vcpu has no other work to do except
> >>   continuing to do gc. In our guest, there are more vcpus than java gc
> >>   threads. So there could always be some available vcpus when
> >>   scheduler tries to select a idle vcpu (runing on host). This leads
> >>   to lots of cpu migrations and results in regression.
> >>
> >>   I'm not really familiar with this mechanism. Is this a problem that
> >>   needs to be fixed or improved? Or is this just expected behavior?
> >>   Any response would be really appreciated!
> > 
> > This is pretty much expected behaviour. When a vCPU is preempted the
> > guest cannot know it's state or latency. Typically in the overcomitted
> > case another vCPU will be running on the CPU and getting our vCPU thread
> > back will take a considerable amount of time.
> 
> I see. Many thanks for your kindly reply and explanation. :)
> 
> > 
> > If you know you're not over-committed, perhaps you should configure your
> > VM differently.
> 
> Do you have any suggestion about how should I configure my VM when it's not over-committed?

I'm not an expert on VMs, but IIRC when you construct a pinned VM (ie.
1:1 vCPU:CPU relations) this all goes away.

      reply	other threads:[~2022-10-29 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28  8:48 Regression on vcpu_is_preempted() Miaohe Lin
2022-10-28 10:21 ` Abel Wu
2022-10-29  2:27   ` Miaohe Lin
2022-10-29  8:58 ` Peter Zijlstra
2022-10-29  9:15   ` Miaohe Lin
2022-10-29 12:23     ` Peter Zijlstra [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=Y10bPHJh7g+4OW4k@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rohit.k.jain@oracle.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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