All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Michael Kelley <mikelley@microsoft.com>
Cc: 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
Subject: Re: [PATCH 0/2] x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes
Date: Thu, 13 Apr 2023 01:34:01 +0000	[thread overview]
Message-ID: <ZDdcCd/KtOGnwKMv@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <1679922967-26582-1-git-send-email-mikelley@microsoft.com>

On Mon, Mar 27, 2023 at 06:16:05AM -0700, Michael Kelley wrote:
> 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(-)

Applied to hyperv-next. Thanks.

> 
> -- 
> 1.8.3.1
> 

      parent reply	other threads:[~2023-04-13  1:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Wei Liu [this message]

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=ZDdcCd/KtOGnwKMv@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --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=mikelley@microsoft.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --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 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.