Re: [PATCH v6 RESEND 1/3] x86/mm/tlb: Make enter_lazy_tlb() always inline on x86

From: Dave Hansen

Date: Mon Feb 09 2026 - 14:24:18 EST


On 2/9/26 08:23, Xie Yuanbin wrote:
> +/*
> + * Please ignore the name of this function. It should be called
> + * switch_to_kernel_thread().
> + *
> + * enter_lazy_tlb() is a hint from the scheduler that we are entering a
> + * kernel thread or other context without an mm. Acceptable implementations
> + * include doing nothing whatsoever, switching to init_mm, or various clever
> + * lazy tricks to try to minimize TLB flushes.
> + *
> + * The scheduler reserves the right to call enter_lazy_tlb() several times
> + * in a row. It will notify us that we're going back to a real mm by
> + * calling switch_mm_irqs_off().
> + */
> +#ifndef MODULE

What's with the #ifndef? Is this to avoid use spreading to modules and
then making us export some other gunk? That seems like a generally good
thing, but it's also totally random, different from the existing
'extern' declaration of enter_lazy_tlb(), and unique in the header.