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
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");
}
void test_arena_atomics(void)
void serial_test_arena_atomics(void)
{
struct arena_atomics *skel;
int err;

View File

@@ -66,7 +66,7 @@ static void test_arena_direct_value_one_past_end(void)
close(map_fd);
}
void test_arena_direct_value(void)
void serial_test_arena_direct_value(void)
{
if (test__start_subtest("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);
}
void test_arena_htab(void)
void serial_test_arena_htab(void)
{
if (test__start_subtest("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);
}
void test_arena_list(void)
void serial_test_arena_list(void)
{
if (test__start_subtest("arena_list_1"))
test_arena_list_add_del(1, false);

View File

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

View File

@@ -23,7 +23,7 @@ static void test_arena_str(void)
arena_strsearch__destroy(skel);
}
void test_arena_strsearch(void)
void serial_test_arena_strsearch(void)
{
if (test__start_subtest("arena_strsearch"))
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);
}
void test_libarena(void)
void serial_test_libarena(void)
{
struct arena_alloc_reserve_args args;
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
* programs.
*/
void test_libarena_asan(void)
void serial_test_libarena_asan(void)
{
#ifdef HAS_BPF_ARENA_ASAN
run_test();