[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e8a156d4c8f5db07cf03b55fb81c75d523cac680.camel@surriel.com>
Date: Tue, 11 Feb 2025 15:21:16 -0500
From: Rik van Riel <riel@...riel.com>
To: Brendan Jackman <jackmanb@...gle.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, bp@...en8.de,
peterz@...radead.org, dave.hansen@...ux.intel.com,
zhengqi.arch@...edance.com, nadav.amit@...il.com, thomas.lendacky@....com,
kernel-team@...a.com, linux-mm@...ck.org, akpm@...ux-foundation.org,
jannh@...gle.com, mhklinux@...look.com, andrew.cooper3@...rix.com, Manali
Shukla <Manali.Shukla@....com>
Subject: Re: [PATCH v9 10/12] x86/mm: do targeted broadcast flushing from
tlbbatch code
On Tue, 2025-02-11 at 11:02 +0100, Brendan Jackman wrote:
>
> So I think here we're encoding the assumption that context_switch()
> always calls either enter_lazy_tlb() or switch_mm_irqs_off(), which
> is
> a little awkward, plus the job of these functions is already kinda
> hazy and this makes it even hazier. What about doing it in
> arch_start_context_switch() instead?
>
> That would mean a bit of plumbing since we'd still wanna have the
> tlbsync() in tlb.c, but that seems worth it to me. Plus, having it in
> one place would give us a spot to add a comment. Now that you point
> it
> out it does indeed seem obvious but it didn't seem so yesterday.
>
While that would be a little bit cleaner to maintain,
in theory, I'm not convinced that adding an extra
function call to the context switch path is worthwhile
for that small maintenance benefit.
I'd rather add more comments than an extra function call :)
> Now I think about it... if we always tlbsync() before a context
> switch, is the cant_migrate() above actually required?
Probably not, but I guess it won't hurt?
I'm running tests right now on a kernel with a bunch
of debug options enabled, and I'm getting all sorts
of warnings, but not this one :)
--
All Rights Reversed.
Powered by blists - more mailing lists