All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Bernhard Kauer <bk@alpico.io>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: drop the kvm_has_noapic_vcpu optimization
Date: Tue, 22 Oct 2024 10:32:59 -0700	[thread overview]
Message-ID: <Zxfhy9uifey4wShq@google.com> (raw)
In-Reply-To: <20241018100919.33814-1-bk@alpico.io>

On Fri, Oct 18, 2024, Bernhard Kauer wrote:
> It used a static key to avoid loading the lapic pointer from
> the vcpu->arch structure.  However, in the common case the load
> is from a hot cacheline and the CPU should be able to perfectly
> predict it. Thus there is no upside of this premature optimization.

Do you happen to have performance numbers?  I've been itching for an excuse to
excise this code for a few years now, the only reason I haven't ripped it out is
because I didn't want to do so without numbers to back up my claim that it's a
premature optimization.

In other words, I agree with your analysis, but I don't want to yank out the code
without at least _some_ numbers to back up the claim, because then we're essentially
committing the same crime of optimizing without measuring.

> The downside is that code patching including an IPI to all CPUs
> is required whenever the first VM without an lapic is created or
> the last is destroyed.

In practice, this almost never happens though.  Do you have a use case for
creating VMs without in-kernel local APICs?

  parent reply	other threads:[~2024-10-22 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 10:08 [PATCH] KVM: drop the kvm_has_noapic_vcpu optimization Bernhard Kauer
2024-10-21  7:43 ` Chao Gao
2024-10-22 17:32 ` Sean Christopherson [this message]
2024-10-22 19:08   ` Bernhard Kauer
2024-10-31 16:24     ` Sean Christopherson
2024-10-31 20:08       ` Bernhard Kauer
2024-10-31 23:29         ` Sean Christopherson
2024-11-01  8:55           ` Bernhard Kauer
2024-11-01 14:49             ` Sean Christopherson
2024-11-15  9:12               ` Bernhard Kauer

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=Zxfhy9uifey4wShq@google.com \
    --to=seanjc@google.com \
    --cc=bk@alpico.io \
    --cc=kvm@vger.kernel.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 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.