Re: [PATCH v4 01/12] x86/mm: make MMU_GATHER_RCU_TABLE_FREE unconditional
From: Borislav Petkov
Date: Tue Jan 14 2025 - 07:32:53 EST
On Sun, Jan 12, 2025 at 10:53:45AM -0500, Rik van Riel wrote:
> Currently x86 uses CONFIG_MMU_GATHER_TABLE_FREE when using
> paravirt, and not when running on bare metal.
>
> There is no real good reason to do things differently for
> each setup. Make them all the same.
>
> Currently get_user_pages_fast synchronizes against page table
> freeing in two different ways:
> - on bare metal, by blocking IRQs, which block TLB flush IPIs
> - on paravirt, with MMU_GATHER_RCU_TABLE_FREE
>
> This is done because some paravirt TLB flush implementations
> handle the TLB flush in the hypervisor, and will do the flush
> even when the target CPU has interrupts disabled.
>
> After this change, the synchronization between get_user_pages_fast
get_user_pages_fast() - make it look like a function.
Avoid having "This patch" or "This commit" or "After this change", etc in the
commit message. It is tautologically useless so use imperative tone directly:
"Always handle page table freeing with..."
> and page table freeing is always handled with MMU_GATHER_RCU_TABLE_FREE,
> which allows bare metal to also do TLB flushes while interrupts are
> disabled.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette