[PATCH] mm: kvmalloc: Bail if called with soft or hard IRQs disabled

Linus Torvalds torvalds at linux-foundation.org
Fri Nov 13 18:19:06 PST 2026


On Fri, 13 Nov 2026 at 16:35, Herbert Xu <herbert at gondor.apana.org.au> wrote:
>
> That would make sense for direct vmalloc calls.  But this is
> kvmalloc, which is supposed to choose automatically between
> kmalloc and vmalloc.

Yes. But that cl;early caused problems, and then people seemed to
start thinking that it meant that the vmalloc side should also work
with GFP_ATOMIC.

If you are in atomic context, then kvmalloc() makes no sense, since
the vmalloc makes no sense. You should use kmalloc.

          Linus



More information about the maple-tree mailing list