Skip to content

x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes

Michael Kelley linux-arch linux-hyperv lkml 1 version Applied

Status from this message: Applied to hyperv-next. Thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2x86/hyperv: Add callback filter to cpumask_to_vpset()arch/x86/hyperv/hv_apic.c include/asm-generic/mshyperv.h+22 -120 replies
2/2x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushesarch/x86/hyperv/mmu.c+10 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes

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(-)
Signature · 1 line
1.8.3.1