]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Use kmalloc_nolock() in range tree
authorPuranjay Mohan <puranjay@kernel.org>
Thu, 6 Nov 2025 17:06:07 +0000 (17:06 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 6 Nov 2025 23:55:19 +0000 (15:55 -0800)
commitf8c67d8550ee69ce684c7015b2c8c63cda24bbfb
tree0b46dd04dc99c453e13f16d215d701d5b583fcb8
parent6f1f4c1638fe95637a43699892c036c9ae908d9a
bpf: Use kmalloc_nolock() in range tree

The range tree uses bpf_mem_alloc() that is safe to be called from all
contexts and uses a pre-allocated pool of memory to serve these
allocations.

Replace bpf_mem_alloc() with kmalloc_nolock() as it can be called safely
from all contexts and is more scalable than bpf_mem_alloc().

Remove the migrate_disable/enable pairs as they were only needed for
bpf_mem_alloc() as it does per-cpu operations, kmalloc_nolock() doesn't
need this.

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Link: https://lore.kernel.org/r/20251106170608.4800-1-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/range_tree.c