Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Check for PREEMPTION instead of PREEMPT

CONFIG_PREEMPT is a preemtion model the so called "Low-Latency Desktop".
A different preemption model is PREEMPT_RT the so called "Real-Time".
Both implement preemption in kernel and set CONFIG_PREEMPTION.
There is also the so called "LAZY PREEMPT" which the "Scheduler
controlled preemption model". Here we have also preemption in the kernel
the rules are slightly different.

Therefore the testsuite should not check for CONFIG_PREEMPT (as one
model) but for CONFIG_PREEMPTION to figure out if preemption in the
kernel is possible.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20241119161819.qvEcs-n_@linutronix.de
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Sebastian Andrzej Siewior and committed by
Alexei Starovoitov
6b64128a ef3ba8c2

+7 -7
+2 -2
tools/testing/selftests/bpf/map_tests/task_storage_map.c
··· 78 78 CHECK(err, "open_and_load", "error %d\n", err); 79 79 80 80 /* Only for a fully preemptible kernel */ 81 - if (!skel->kconfig->CONFIG_PREEMPT) { 82 - printf("%s SKIP (no CONFIG_PREEMPT)\n", __func__); 81 + if (!skel->kconfig->CONFIG_PREEMPTION) { 82 + printf("%s SKIP (no CONFIG_PREEMPTION)\n", __func__); 83 83 read_bpf_task_storage_busy__destroy(skel); 84 84 skips++; 85 85 return;
+1 -1
tools/testing/selftests/bpf/prog_tests/task_local_storage.c
··· 197 197 /* Unnecessary recursion and deadlock detection are reproducible 198 198 * in the preemptible kernel. 199 199 */ 200 - if (!skel->kconfig->CONFIG_PREEMPT) { 200 + if (!skel->kconfig->CONFIG_PREEMPTION) { 201 201 test__skip(); 202 202 goto done; 203 203 }
+2 -2
tools/testing/selftests/bpf/progs/read_bpf_task_storage_busy.c
··· 4 4 #include <bpf/bpf_helpers.h> 5 5 #include <bpf/bpf_tracing.h> 6 6 7 - extern bool CONFIG_PREEMPT __kconfig __weak; 7 + extern bool CONFIG_PREEMPTION __kconfig __weak; 8 8 extern const int bpf_task_storage_busy __ksym; 9 9 10 10 char _license[] SEC("license") = "GPL"; ··· 24 24 { 25 25 int *value; 26 26 27 - if (!CONFIG_PREEMPT) 27 + if (!CONFIG_PREEMPTION) 28 28 return 0; 29 29 30 30 if (bpf_get_current_pid_tgid() >> 32 != pid)
+2 -2
tools/testing/selftests/bpf/progs/task_storage_nodeadlock.c
··· 10 10 #define EBUSY 16 11 11 #endif 12 12 13 - extern bool CONFIG_PREEMPT __kconfig __weak; 13 + extern bool CONFIG_PREEMPTION __kconfig __weak; 14 14 int nr_get_errs = 0; 15 15 int nr_del_errs = 0; 16 16 ··· 29 29 int ret, zero = 0; 30 30 int *value; 31 31 32 - if (!CONFIG_PREEMPT) 32 + if (!CONFIG_PREEMPTION) 33 33 return 0; 34 34 35 35 task = bpf_get_current_task_btf();