Skip to content

Commit 6b64128

Browse files
Sebastian Andrzej SiewiorAlexei Starovoitov
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent ef3ba8c commit 6b64128

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

tools/testing/selftests/bpf/map_tests/task_storage_map.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ void test_task_storage_map_stress_lookup(void)
7878
CHECK(err, "open_and_load", "error %d\n", err);
7979

8080
/* 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__);
8383
read_bpf_task_storage_busy__destroy(skel);
8484
skips++;
8585
return;

tools/testing/selftests/bpf/prog_tests/task_local_storage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static void test_nodeadlock(void)
197197
/* Unnecessary recursion and deadlock detection are reproducible
198198
* in the preemptible kernel.
199199
*/
200-
if (!skel->kconfig->CONFIG_PREEMPT) {
200+
if (!skel->kconfig->CONFIG_PREEMPTION) {
201201
test__skip();
202202
goto done;
203203
}

tools/testing/selftests/bpf/progs/read_bpf_task_storage_busy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <bpf/bpf_helpers.h>
55
#include <bpf/bpf_tracing.h>
66

7-
extern bool CONFIG_PREEMPT __kconfig __weak;
7+
extern bool CONFIG_PREEMPTION __kconfig __weak;
88
extern const int bpf_task_storage_busy __ksym;
99

1010
char _license[] SEC("license") = "GPL";
@@ -24,7 +24,7 @@ int BPF_PROG(read_bpf_task_storage_busy)
2424
{
2525
int *value;
2626

27-
if (!CONFIG_PREEMPT)
27+
if (!CONFIG_PREEMPTION)
2828
return 0;
2929

3030
if (bpf_get_current_pid_tgid() >> 32 != pid)

tools/testing/selftests/bpf/progs/task_storage_nodeadlock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ char _license[] SEC("license") = "GPL";
1010
#define EBUSY 16
1111
#endif
1212

13-
extern bool CONFIG_PREEMPT __kconfig __weak;
13+
extern bool CONFIG_PREEMPTION __kconfig __weak;
1414
int nr_get_errs = 0;
1515
int nr_del_errs = 0;
1616

@@ -29,7 +29,7 @@ int BPF_PROG(socket_post_create, struct socket *sock, int family, int type,
2929
int ret, zero = 0;
3030
int *value;
3131

32-
if (!CONFIG_PREEMPT)
32+
if (!CONFIG_PREEMPTION)
3333
return 0;
3434

3535
task = bpf_get_current_task_btf();

0 commit comments

Comments
 (0)