All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Wen Yang <wenyang@linux.alibaba.com>
Cc: Sasha Levin <sashal@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dave Hansen <dave.hansen@intel.com>,
	Bin Yang <bin.yang@intel.com>, Mark Gross <mark.gross@intel.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 4.19] x86/mm/cpa: Unconditionally avoid WBINDV when we can
Date: Mon, 4 Jul 2022 17:59:23 +0200	[thread overview]
Message-ID: <YsMOWwHRUdQ/zLmx@kroah.com> (raw)
In-Reply-To: <20220704154508.13317-1-wenyang@linux.alibaba.com>

On Mon, Jul 04, 2022 at 11:45:08PM +0800, Wen Yang wrote:
> From: Peter Zijlstra <peterz@infradead.org>
> 
> commit ddd07b750382adc2b78fdfbec47af8a6e0d8ef37 upstream.
> 
> CAT has happened, WBINDV is bad (even before CAT blowing away the
> entire cache on a multi-core platform wasn't nice), try not to use it
> ever.
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Reviewed-by: Dave Hansen <dave.hansen@intel.com>
> Cc: Bin Yang <bin.yang@intel.com>
> Cc: Mark Gross <mark.gross@intel.com>
> Link: https://lkml.kernel.org/r/20180919085947.933674526@infradead.org
> Cc: <stable@vger.kernel.org> # 4.19.x
> Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
> ---
>  arch/x86/mm/pageattr.c | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
> index 101f3ad0d6ad..ab87da7a6043 100644
> --- a/arch/x86/mm/pageattr.c
> +++ b/arch/x86/mm/pageattr.c
> @@ -239,26 +239,12 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,
>  			    int in_flags, struct page **pages)
>  {
>  	unsigned int i, level;
> -#ifdef CONFIG_PREEMPT
> -	/*
> -	 * Avoid wbinvd() because it causes latencies on all CPUs,
> -	 * regardless of any CPU isolation that may be in effect.
> -	 *
> -	 * This should be extended for CAT enabled systems independent of
> -	 * PREEMPT because wbinvd() does not respect the CAT partitions and
> -	 * this is exposed to unpriviledged users through the graphics
> -	 * subsystem.
> -	 */
> -	unsigned long do_wbinvd = 0;
> -#else
> -	unsigned long do_wbinvd = cache && numpages >= 1024; /* 4M threshold */
> -#endif
>  
>  	BUG_ON(irqs_disabled() && !early_boot_irqs_disabled);
>  
> -	on_each_cpu(__cpa_flush_all, (void *) do_wbinvd, 1);
> +	flush_tlb_all();
>  
> -	if (!cache || do_wbinvd)
> +	if (!cache)
>  		return;
>  
>  	/*
> -- 
> 2.19.1.6.gb485710b
> 

Why is this needed on 4.19.y?  What problem does it solve, it looks only
like an optimization, not a bugfix.

And if it's a bugfix, why only 4.19.y, why not older kernels too?

We need more information here please.

thanks,

greg k-h

  reply	other threads:[~2022-07-04 15:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 15:45 [PATCH 4.19] x86/mm/cpa: Unconditionally avoid WBINDV when we can Wen Yang
2022-07-04 15:59 ` Greg Kroah-Hartman [this message]
2022-07-05  3:45   ` Wen Yang
2022-07-05  4:18     ` Dave Hansen
2022-07-05  4:39     ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2022-07-05  6:02 Wen Yang
2022-07-05  6:26 ` Greg Kroah-Hartman
2022-07-04  8:28 Wen Yang
2022-07-04 11:05 ` Greg Kroah-Hartman
2022-07-04 14:29   ` Wen Yang
2022-07-04 15:05     ` Greg Kroah-Hartman

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=YsMOWwHRUdQ/zLmx@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bin.yang@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=mark.gross@intel.com \
    --cc=peterz@infradead.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wenyang@linux.alibaba.com \
    /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.