[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241114144007.GB39245@noisy.programming.kicks-ass.net>
Date: Thu, 14 Nov 2024 15:40:07 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Rik van Riel <riel@...riel.com>
Cc: Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
linux-kernel@...r.kernel.org, dave.hansen@...ux.intel.com,
luto@...nel.org, tglx@...utronix.de, mingo@...hat.com,
x86@...nel.org, kernel-team@...a.com, hpa@...or.com,
bigeasy@...utronix.de
Subject: Re: [PATCh 0/3] x86,tlb: context switch optimizations
On Thu, Nov 14, 2024 at 09:27:25AM -0500, Rik van Riel wrote:
> 1) Move the interrupt re-enabling up (probably not this one?)
Correct, that one is wrong for it results in IPIs that we don't want or
need.
> 2) Explicitly clear the mm_cpumask bit in unuse_temporary_mm()
>
> 3) Have unuse_temporary_mm increment the mm's tlb_gen, since that
> is the only thing flush_tlb_mm_range really does for an MM
> without any bits set in the mm_cpumask.
So flush_tlb_mm_range() has an 'mm == loaded_mm' case, which does a
local flush. I *think* we're not hitting that because switch_mm() does a
write to loaded_mm() just before this.
But I don't think we want to proliferate the logic contained in
flush_tlb_mm_range() further than we have to.
So my preference goes to 2, as that seems to be the safest option.
Notably text_poke() it not concerned with performance much.
Powered by blists - more mailing lists