From: Michael Kelley <mikelley@microsoft.com>
To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
arnd@arndb.de, x86@kernel.org, linux-kernel@vger.kernel.org,
linux-hyperv@vger.kernel.org, linux-arch@vger.kernel.org
Cc: mikelley@microsoft.com
Subject: [PATCH 0/2] x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes
Date: Mon, 27 Mar 2023 06:16:05 -0700 [thread overview]
Message-ID: <1679922967-26582-1-git-send-email-mikelley@microsoft.com> (raw)
The Hyper-V enlightened TLB remote flush function does not exclude
lazy TLB mode CPUs like the equivalent native function. Limited
telemetry shows that up to 80% of the CPUs being flushed are in
lazy mode, so flushing them is unnecessary and wasteful.
The best place to exclude the lazy TLB mode CPUs is when copying
the Linux cpumask to the Hyper-V VPset data structure, since the
copying already processes CPUs one-by-one. Currently this copying
function has the capabilty to exclude the calling CPU. Generalize
this exclusion functionality to exclude CPUs based on a callback
function that is invoked for each CPU. Then for TLB flushing,
use this callback function to check the lazy TLB mode status of
each targeted CPU.
Patch 1 of this series does the generalization, and fixes up the
one caller of the existing "exclude self" capability.
Patch 2 then implements the exclusion based on lazy TLB mode,
using the generalization from Patch 1.
Michael Kelley (2):
x86/hyperv: Add callback filter to cpumask_to_vpset()
x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes
arch/x86/hyperv/hv_apic.c | 12 ++++++++----
arch/x86/hyperv/mmu.c | 11 ++++++++++-
include/asm-generic/mshyperv.h | 22 ++++++++++++++--------
3 files changed, 32 insertions(+), 13 deletions(-)
--
1.8.3.1
next reply other threads:[~2023-03-27 13:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 13:16 Michael Kelley [this message]
2023-03-27 13:16 ` [PATCH 1/2] x86/hyperv: Add callback filter to cpumask_to_vpset() Michael Kelley
2023-03-27 13:16 ` [PATCH 2/2] x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes Michael Kelley
2023-04-13 1:34 ` [PATCH 0/2] " Wei Liu
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=1679922967-26582-1-git-send-email-mikelley@microsoft.com \
--to=mikelley@microsoft.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=wei.liu@kernel.org \
--cc=x86@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 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).