Re: [PATCH v4 07/10] kmsan: Remove hard-coded GFP_KERNEL flags
From: Alexander Potapenko
Date: Tue Oct 07 2025 - 08:38:20 EST
On Tue, Oct 7, 2025 at 2:20 PM Uladzislau Rezki (Sony) <urezki@xxxxxxxxx> wrote:
>
> kmsan_vmap_pages_range_noflush() allocates its temp s_pages/o_pages
> arrays with GFP_KERNEL, which may sleep. This is inconsistent with
> vmalloc() as it will support non-blocking requests later.
>
> Plumb gfp_mask through the kmsan_vmap_pages_range_noflush(), so it
> can use it internally for its demand.
>
> Please note, the subsequent __vmap_pages_range_noflush() still uses
> GFP_KERNEL and can sleep. If a caller runs under reclaim constraints,
> sleeping is forbidden, it must establish the appropriate memalloc
> scope API.
>
> Cc: Alexander Potapenko <glider@xxxxxxxxxx>
> Cc: Marco Elver <elver@xxxxxxxxxx>
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
Reviewed-by: Alexander Potapenko <glider@xxxxxxxxxx>
Thank you!