Re: [PATCH 1/2] mm/slab: Add kvfree_atomic() helper

From: Uladzislau Rezki

Date: Wed Apr 29 2026 - 04:59:08 EST


On Wed, Apr 29, 2026 at 10:28:02AM +0200, Vlastimil Babka wrote:
> +Cc SLAB maintainers. Please use get_maintainers.pl next time.
>
> On 4/28/26 18:14, Uladzislau Rezki (Sony) wrote:
> > kvmalloc() now supports non-sleeping GFP flags, including
> > the vmalloc fallback path. This means it may return vmalloc
> > memory even for GFP_ATOMIC and GFP_NOWAIT allocations.
> >
> > Freeing such memory with kvfree() may then end up calling
> > vfree(), which is not safe for non-sleeping contexts.
> >
> > Introduce kvfree_atomic() helper for such cases. It mirrors
> > kvfree(), but uses vfree_atomic() for vmalloced memory.
> >
> > Signed-off-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
>
> Acked-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
>
Thank you and thank you for adding SLAB maintainers!

--
Uladzislau Rezki