]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/slab: allow __GFP_NOMEMALLOC and __GFP_NOWARN for kmalloc_nolock()
authorVlastimil Babka (SUSE) <vbabka@kernel.org>
Wed, 10 Jun 2026 15:40:15 +0000 (17:40 +0200)
committerVlastimil Babka (SUSE) <vbabka@kernel.org>
Mon, 15 Jun 2026 11:26:29 +0000 (13:26 +0200)
commit6dbded46e447113da97bed4a68b02b8aaaffa995
treead57819add2c7da65a25db985cf6a1f6a23c256a
parentd659903674af9d29b6bbde1768004da9cb99d676
mm/slab: allow __GFP_NOMEMALLOC and __GFP_NOWARN for kmalloc_nolock()

The two flags are added internally so there's no point for warning if
they are passed by the caller as well, so allow them. This will allow
simplifying obj_ext allocation under kmalloc_nolock().

Also it's not necessary to have the extra alloc_gfp variable for adding
the two flags. The original gfp_flags parameter is not used anywhere
except for the warning. So remove alloc_gfp and directly modify and use
gfp_flags everywhere.

Link: https://patch.msgid.link/20260610-slab_alloc_flags-v2-13-7190909db118@kernel.org
Reviewed-by: Hao Li <hao.li@linux.dev>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Harry Yoo (Oracle) <harry@kernel.org>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
include/linux/slab.h
mm/slub.c