linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes
@ 2023-03-27 13:16 Michael Kelley
  2023-03-27 13:16 ` [PATCH 1/2] x86/hyperv: Add callback filter to cpumask_to_vpset() Michael Kelley
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Kelley @ 2023-03-27 13:16 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, tglx, mingo, bp, dave.hansen, hpa,
	arnd, x86, linux-kernel, linux-hyperv, linux-arch
  Cc: mikelley

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-13  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-27 13:16 [PATCH 0/2] x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes Michael Kelley
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

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).