diff options
| author | Puranjay Mohan <puranjay@kernel.org> | 2025-12-22 11:50:17 -0800 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2025-12-23 11:29:59 -0800 |
| commit | 360c35f8ffae0f184805d9eb7d126474345bac9b (patch) | |
| tree | c6f2c0706ebf08c9d4ddc580e2d5ed2c82721662 /include/linux | |
| parent | c336b0b327120052c331f6839ee60069065a7c74 (diff) | |
bpf: arena: use kmalloc_nolock() in place of kvcalloc()
To make arena_alloc_pages() safe to be called from any context, replace
kvcalloc() with kmalloc_nolock() so as it doesn't sleep or take any
locks. kmalloc_nolock() returns NULL for allocations larger than
KMALLOC_MAX_CACHE_SIZE, which is (PAGE_SIZE * 2) = 8KB on systems with
4KB pages. So, round down the allocation done by kmalloc_nolock to 1024
* 8 and reuse the array in a loop.
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Link: https://lore.kernel.org/r/20251222195022.431211-3-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
