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

From: Linus Torvalds

Date: Fri Nov 13 2026 - 21:19:45 EST


On Fri, 13 Nov 2026 at 16:35, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> 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