selftests/bpf: Run arena tests serially

Every arena reserves a 4GB kernel vmalloc region at creation, and on a
KASAN build that eagerly populates ~512MB of shadow memory per arena. When
several arena tests run in parallel their shadow adds up, exhausts the
memory of a small CI VM and trips the OOM killer during map creation.

Make the dedicated arena tests (arena_* and libarena*) serial so they no
longer pile up in the parallel phase. That alone brings the peak number of
live arenas back within the CI memory budget.

A few other tests such as verifier_arena*, stream and compute_live_registers
create an arena too, but they run inside shared RUN_TESTS()/RUN() suites, so
turning them serial would drag many unrelated subtests along with them.
Leave those as-is.

Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/bpf/20260717114117.350851-4-jiayuan.chen@linux.dev
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
This commit is contained in:
Jiayuan Chen 2026-07-17 19:37:03 +08:00 committed by Kumar Kartikeya Dwivedi
parent 89318afb14
commit a14f9ba080
No known key found for this signature in database
GPG Key ID: 472D377B63542F83
8 changed files with 8 additions and 8 deletions

View File

@ -222,7 +222,7 @@ static void test_store_release(struct arena_atomics *skel)
"store_release64_result"); "store_release64_result");
} }
void test_arena_atomics(void) void serial_test_arena_atomics(void)
{ {
struct arena_atomics *skel; struct arena_atomics *skel;
int err; int err;

View File

@ -66,7 +66,7 @@ static void test_arena_direct_value_one_past_end(void)
close(map_fd); close(map_fd);
} }
void test_arena_direct_value(void) void serial_test_arena_direct_value(void)
{ {
if (test__start_subtest("one_past_end")) if (test__start_subtest("one_past_end"))
test_arena_direct_value_one_past_end(); test_arena_direct_value_one_past_end();

View File

@ -81,7 +81,7 @@ static void test_arena_htab_asm(void)
arena_htab_asm__destroy(skel); arena_htab_asm__destroy(skel);
} }
void test_arena_htab(void) void serial_test_arena_htab(void)
{ {
if (test__start_subtest("arena_htab_llvm")) if (test__start_subtest("arena_htab_llvm"))
test_arena_htab_llvm(); test_arena_htab_llvm();

View File

@ -68,7 +68,7 @@ static void test_arena_list_add_del(int cnt, bool nonsleepable)
arena_list__destroy(skel); arena_list__destroy(skel);
} }
void test_arena_list(void) void serial_test_arena_list(void)
{ {
if (test__start_subtest("arena_list_1")) if (test__start_subtest("arena_list_1"))
test_arena_list_add_del(1, false); test_arena_list_add_del(1, false);

View File

@ -101,7 +101,7 @@ static void test_arena_spin_lock_size(int size)
return; return;
} }
void test_arena_spin_lock(void) void serial_test_arena_spin_lock(void)
{ {
repeat = 1000; repeat = 1000;
if (test__start_subtest("arena_spin_lock_1")) if (test__start_subtest("arena_spin_lock_1"))

View File

@ -23,7 +23,7 @@ static void test_arena_str(void)
arena_strsearch__destroy(skel); arena_strsearch__destroy(skel);
} }
void test_arena_strsearch(void) void serial_test_arena_strsearch(void)
{ {
if (test__start_subtest("arena_strsearch")) if (test__start_subtest("arena_strsearch"))
test_arena_str(); test_arena_str();

View File

@ -202,7 +202,7 @@ static void run_libarena_parallel_test(struct libarena *skel, struct bpf_program
run_libarena_parallel_fini(skel, name, prefixlen); run_libarena_parallel_fini(skel, name, prefixlen);
} }
void test_libarena(void) void serial_test_libarena(void)
{ {
struct arena_alloc_reserve_args args; struct arena_alloc_reserve_args args;
struct libarena *skel; struct libarena *skel;

View File

@ -85,7 +85,7 @@ static void run_test(void)
* Run the test depending on whether LLVM can compile arena ASAN * Run the test depending on whether LLVM can compile arena ASAN
* programs. * programs.
*/ */
void test_libarena_asan(void) void serial_test_libarena_asan(void)
{ {
#ifdef HAS_BPF_ARENA_ASAN #ifdef HAS_BPF_ARENA_ASAN
run_test(); run_test();