linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <kernellwp@gmail.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH] KVM: Disable wake-affine vCPU process to mitigate lock holder preemption
Date: Thu, 01 Aug 2019 14:39:34 +0200	[thread overview]
Message-ID: <6d9e85ac5768e920805f121eeaff1360f3b257df.camel@suse.com> (raw)
In-Reply-To: <19e0beb6-a732-ea1f-79a5-41be92569338@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

On Tue, 2019-07-30 at 13:46 +0200, Paolo Bonzini wrote:
> On 30/07/19 11:33, Wanpeng Li wrote:
> > When qemu/other vCPU inject virtual interrupt to guest through
> > waking up one 
> > sleeping vCPU, it increases the probability to stack vCPUs/qemu by
> > scheduler
> > wake-affine. vCPU stacking issue can greately inceases the lock
> > synchronization 
> > latency in a virtualized environment. This patch disables wake-
> > affine vCPU 
> > process to mitigtate lock holder preemption.
> 
> There is no guarantee that the vCPU remains on the thread where it's
> created, so the patch is not enough.
> 
> If many vCPUs are stacked on the same pCPU, why doesn't the wake_cap
> kick in sooner or later?
> 
Assuming it actually is the case that vcpus *do* get stacked *and* that
wake_cap() *doesn't* kick in, maybe it could be because of this check?

        /* Minimum capacity is close to max, no need to abort wake_affine */
        if (max_cap - min_cap < max_cap >> 3)
                return 0;

Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-08-01 12:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30  9:33 [PATCH] KVM: Disable wake-affine vCPU process to mitigate lock holder preemption Wanpeng Li
2019-07-30 11:46 ` Paolo Bonzini
2019-08-01 12:39   ` Dario Faggioli [this message]
2019-07-30 12:09 ` Peter Zijlstra
2019-08-01 12:57 ` Dario Faggioli
2019-08-02  0:51   ` Wanpeng Li
2019-08-02  8:30   ` Christophe de Dinechin
2019-08-02  8:38   ` Paolo Bonzini

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=6d9e85ac5768e920805f121eeaff1360f3b257df.camel@suse.com \
    --to=dfaggioli@suse.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    /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).