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

From: Dave Hansen

Date: Tue Feb 10 2026 - 11:07:52 EST


On 2/10/26 07:32, Xie Yuanbin wrote:
> This was just to fix a compilation error:
> 'cpu_tlbstate' is defined in 'include/asm/tlbflush.h' inside of
> '#ifndef MODULE'. So if the '#ifndef MODULE' is not added here,
> the compilation error will be triggered:

Rather than sprinkling #ifdefs and 'cpu_tlbstate' references around,
could we try to keep them confined to asm/tlbflush.h as much as
possible, please?

I mean, mmu_context.h _does_ include asm/tlbflush.h, so even if you
stuck enter_lazy_tlb() in asm/tlbflush.h, everything should keep
working, no?

That would both prevent adding a random #ifdef and keep 'cpu_tlbstate'
references limited.