Re: [PATCH] mm/vmalloc: clarify why vmap_range_noflush() might sleep
From: Uladzislau Rezki
Date: Mon Dec 08 2025 - 12:36:56 EST
On Mon, Dec 08, 2025 at 07:39:39AM +0000, Brendan Jackman wrote:
> Hi Anshuman, thanks a lot for taking a look.
>
> On Mon Dec 8, 2025 at 6:41 AM UTC, Anshuman Khandual wrote:
> > Please add <asm-generic/pgalloc.h> in mm/vmalloc.c - otherwise it does not
> > get built as GFP_PGTABLE_KERNEL is not available. But otherwise LGTM.
>
> Oh, but that's not correct, IIUC we shouldn't directly be including
> asm-generic headers from here.
>
> So while in principle GFP_PGTABLE_KERNEL is a sensible common
> demoninator here, it doesn't actually exist at all everywhere, e.g. it
> doesn't look like m68k defines it for Motorola.
>
> So maybe the best way here is a really vague:
>
> /*
> * Different archs allocate pagetables in different ways, assume
> * GFP_KERNEL as a common denominator.
> */
> might_alloc(GFP_KERNEL)
>
> ... a bit yucky but I think still useful.
>
> Any thoughts?
>
Maybe just add a comment why that might_sleep() is there?
We can simply state that page table allocation path is hard-coded
internally to use GFP_KERNEL flag.
Thanks!
--
Uladzislau Rezki