]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: Add sleepable variant of bpf_arena_alloc_pages for kernel callers
authorTejun Heo <tj@kernel.org>
Fri, 22 May 2026 17:22:14 +0000 (07:22 -1000)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 23 May 2026 08:50:33 +0000 (01:50 -0700)
commitf211c81ddc368e5cc6ad69d171bca0fa52e71ad7
tree88725b232c2d6915422a67f27b17303f642241b7
parentdc11a4dba2464e5144c318ffaf7fb16b1a5c74d6
bpf: Add sleepable variant of bpf_arena_alloc_pages for kernel callers

The existing kernel-side export of bpf_arena_alloc_pages is _non_sleepable
only - it's used by the verifier to inline the kfunc when the call site is
non-sleepable. There is no sleepable equivalent for kernel callers. The
kfunc bpf_arena_alloc_pages itself is BPF-only.

sched_ext needs sleepable kernel-side allocs for its arena pool init/grow
paths. Add bpf_arena_alloc_pages_sleepable() mirroring the _non_sleepable
wrapper but passing sleepable=true to arena_alloc_pages().

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/r/20260522172219.1423324-4-tj@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/arena.c