Re: [PATCH] x86/mm: Revert INVLPGB optimization for set_memory code
From: Hellstrom, Thomas
Date: Wed Apr 22 2026 - 03:59:56 EST
On Tue, 2026-04-21 at 11:46 -0700, Dave Hansen wrote:
> On 4/21/26 11:42, Edgecombe, Rick P wrote:
> > Makes sense. And I see the merit in just trying to revert the
> > change. But I
> > think a change to fix the optimization is also temptingly small:
>
> Yeah, it is tempting. It's probably what I would have done if this
> wasn't easy to revert, or if it wasn't _just_ an optimization.
>
> But once -rc1 hits, we should definitely revisit the optimization.
Are there any timings available for how bad a global TLB flush affects
system performance vs a single IPI invalidating a limited set of TLB
entries that aren't likely to be re-populated soon?
An uneducated guess would probably always favor the latter.
The set_pages_array_wc() is unfortunately a rather common operation
when allocating integrated graphics buffer objects. At least until a
pool of WC pages has been established by the graphics drivers. And I
think when this is happening it's reasonable to accept a predictable
allocation delay vs to have the full TLB invalidated across all cores
repeatedly?
Thanks,
Thomas