Re: [PATCH] mm: kvmalloc: Bail if called with soft or hard IRQs disabled
From: Herbert Xu
Date: Fri Nov 13 2026 - 19:56:52 EST
On Fri, Nov 13, 2026 at 09:47:13AM -0800, Linus Torvalds wrote:
>
> I don't think this is wrong, but I do wonder if we should at least
> have *some* way to detect these cases and report them.
That would make sense for direct vmalloc calls. But this is
kvmalloc, which is supposed to choose automatically between
kmalloc and vmalloc.
It was you who suggested moving this check from the caller into
kvmalloc (2018):
https://lore.kernel.org/all/CA+55aFxvNCEBQsxfr=yL3jgxiC8M8wY2MHwVBH+T8qSWyP-WPg@xxxxxxxxxxxxxx/
That worked perfectly until kvmalloc started allowing vmalloc for
non-blocking callers (2025):
https://lore.kernel.org/all/20251007122035.56347-1-urezki@xxxxxxxxx/
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt