]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Fix arena_spin_lock on systems with less than 16 CPUs
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 24 Apr 2025 16:41:26 +0000 (18:41 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 25 Apr 2025 00:24:28 +0000 (17:24 -0700)
commit0240e5a9431cb48f980fd44f913d7f0886b0aded
tree1c031b45c7cee62e5316b77c8fc498e8b235ba7b
parentddfd1f30b5badcd06c199fa519bec5f0f54892e0
selftests/bpf: Fix arena_spin_lock on systems with less than 16 CPUs

test_arena_spin_lock_size() explicitly requires having at least 2 CPUs,
but if the machine has less than 16, then pthread_setaffinity_np() call
in spin_lock_thread() fails.

Cap threads to the number of CPUs.

Alternative solutions are raising the number of required CPUs to 16, or
pinning multiple threads to the same CPU, but they are not that useful.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20250424165525.154403-3-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/arena_spin_lock.c