[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <79975f50-7a98-4629-9ed8-c32596cab46a@intel.com>
Date: Wed, 21 May 2025 08:16:23 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Rik van Riel <riel@...riel.com>, linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, x86@...nel.org, kernel-team@...a.com,
dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
nadav.amit@...il.com, Rik van Riel <riel@...com>,
Yu-cheng Yu <yu-cheng.yu@...el.com>
Subject: Re: [RFC v2 5/9] x86/mm: Change cpa_flush() to call
flush_kernel_range() directly
On 5/19/25 18:02, Rik van Riel wrote:
> The function cpa_flush() calls __flush_tlb_one_kernel() and
> flush_tlb_all().
>
> Replacing that with a call to flush_tlb_kernel_range() allows
> cpa_flush() to make use of INVLPGB or RAR without any additional
> changes.
Yeah, the pageattr.c flushing code has gone through some twists and
turns over the years but it does indeed look like it has converged to be
awfully close to the other flushing code. It used to do wbinvd() and a
full flush, but the wbinvd() disappeared at some point.
I don't immediately see any downsides to doing this. You could probably
even hoist this up to the top of the series. I think it's a good cleanup
on its own.
Also, I'd make the point in the subject and changelog that this isn't
just changing one function to call another, it's removing some
duplicated functionality and consolidating it to existing common code.
Maybe this for the subject:
x86/mm: Have cpa_flush() use common TLB flushing infrastructure
One super nit:
> + start = fix_addr(__cpa_addr(cpa, 0));
> + end = fix_addr(__cpa_addr(cpa, cpa->numpages));
Please vertically align the fix_addr()'s.
Powered by blists - more mailing lists