All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Jim Mattson <jmattson@google.com>
Cc: Robert Hoo <robert.hoo.linux@gmail.com>,
	zhuangel570 <zhuangel570@gmail.com>,
	kvm@vger.kernel.org
Subject: Re: Latency issues inside KVM.
Date: Mon, 1 May 2023 14:11:55 -0700	[thread overview]
Message-ID: <ZFArG0WsL0e/bM+m@google.com> (raw)
In-Reply-To: <CALMp9eTa3OpmMY5_9fezDfBb4gjne2yrHxBnnkD4xG7AzWmw+A@mail.gmail.com>

On Mon, May 01, 2023, Jim Mattson wrote:
> On Mon, May 1, 2023 at 7:51 AM Sean Christopherson <seanjc@google.com> wrote:
> >
> > On Sat, Apr 29, 2023, Robert Hoo wrote:
> > > On 4/27/2023 8:38 PM, zhuangel570 wrote:
> > > > - kvm_vm_create_worker_thread introduce tail latency more than 100ms.
> > > >    This function was called when create "kvm-nx-lpage-recovery" kthread when
> > > >    create a new VM, this patch was introduced to recovery large page to relief
> > > >    performance loss caused by software mitigation of ITLB_MULTIHIT, see
> > > >    b8e8c8303ff2 ("kvm: mmu: ITLB_MULTIHIT mitigation") and 1aa9b9572b10
> > > >    ("kvm: x86: mmu: Recovery of shattered NX large pages").
> > > >
> > > Yes, this kthread is for NX-HugePage feature and NX-HugePage in turn is to
> > > SW mitigate itlb-multihit issue.
> > > However, HW level mitigation has been available for quite a while, you can
> > > check "/sys/devices/system/cpu/vulnerabilities/itlb_multihit" for your
> > > system's mitigation status.
> > > I believe most recent Intel CPUs have this HW mitigated (check
> > > MSR_ARCH_CAPABILITIES::IF_PSCHANGE_MC_NO), let alone non-Intel CPUs.
> > > But, the kvm_vm_create_worker_thread is still created anyway, nonsense I
> > > think. I previously had a internal patch getting rid of it but didn't get a
> > > chance to send out.
> >
> > For the NX hugepage mitation, I think it makes sense to restart the discussion
> > in the context of this thread: https://lore.kernel.org/all/ZBxf+ewCimtHY2XO@google.com
> >
> > TL;DR: I am open to providng an option to hard disable the mitigation, but there
> > needs to be sufficient justification, e.g. that the above 100ms latency is a
> > problem for real world deployments.
> 
> Whatever became of
> https://lore.kernel.org/kvm/20220613212523.3436117-1-bgardon@google.com/?

That's merged, but disabling the mitigation for a single VM doesn't stop the
worker thread (arguably that's a bug), let alone prevent creation of the worker
in the first place as KVM spawns the worker before the VM is exposed to
userspace.  I.e. there's no way for userspace to say "don't spawn workers, the
NX hugepage mitigation will *never* be enabled".

  reply	other threads:[~2023-05-01 21:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 12:38 Latency issues inside KVM zhuangel570
2023-04-29  3:28 ` Robert Hoo
2023-05-01 14:51   ` Sean Christopherson
2023-05-01 20:03     ` Jim Mattson
2023-05-01 21:11       ` Sean Christopherson [this message]
2023-05-02  1:16     ` Robert Hoo
2023-05-02  3:17       ` Jim Mattson
2023-05-02  6:12         ` Robert Hoo
2023-05-04 13:32   ` zhuangel570

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=ZFArG0WsL0e/bM+m@google.com \
    --to=seanjc@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=robert.hoo.linux@gmail.com \
    --cc=zhuangel570@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.