Re: [linus:master] [mm] c6307674ed: BUG:sleeping_function_called_from_invalid_context_at_mm/vmalloc.c

From: Uladzislau Rezki

Date: Wed Apr 22 2026 - 04:35:37 EST


On Wed, Apr 22, 2026 at 03:59:21PM +0800, Herbert Xu wrote:
> On Wed, Apr 22, 2026 at 09:17:54AM +0200, Uladzislau Rezki wrote:
> >
> > since your GFP_ATOMIC context allocated chunk of memory using vmalloc()
> > sense kvfree() uses vfree(). The simplest fix to free via RCU.
>
> Why is kvmalloc returning vmalloc memory under GFP_ATOMIC?
> Is there a new GFP flag to tell it to not return vmalloc memory?
>
> This has been working for over a decade, what changed?
>
We have added non-sleeping flags for vmalloc() to extend kvmalloc()
functionality as folk need those.

Another option, would be: always use vfree_atomic() from the kvfree()
path.

Any thoughts?

--
Uladzislau Rezki