mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
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:
parent
89318afb14
commit
a14f9ba080
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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"))
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user