From: Alexei Starovoitov Date: Wed, 4 Feb 2026 05:51:47 +0000 (-0800) Subject: selftests/bpf: Strengthen timer_start_deadlock test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e65cf81accf908d2480739b85dba4731048290d;p=thirdparty%2Fkernel%2Flinux.git selftests/bpf: Strengthen timer_start_deadlock test Strengthen timer_start_deadlock test and check for recursion now Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20260204055147.54960-5-alexei.starovoitov@gmail.com --- diff --git a/tools/testing/selftests/bpf/progs/timer_start_deadlock.c b/tools/testing/selftests/bpf/progs/timer_start_deadlock.c index 368563747a469..019518ee18cd5 100644 --- a/tools/testing/selftests/bpf/progs/timer_start_deadlock.c +++ b/tools/testing/selftests/bpf/progs/timer_start_deadlock.c @@ -31,7 +31,6 @@ SEC("tp_btf/hrtimer_cancel") int BPF_PROG(tp_hrtimer_cancel, struct hrtimer *hrtimer) { struct bpf_timer *timer; - static bool called = false; int key = 0; if (!in_timer_start) @@ -42,13 +41,9 @@ int BPF_PROG(tp_hrtimer_cancel, struct hrtimer *hrtimer) /* * Call bpf_timer_start() from the tracepoint within hrtimer logic - * on the same timer to make sure it doesn't deadlock, - * and do it once. + * on the same timer to make sure it doesn't deadlock. */ - if (!called) { - called = true; - bpf_timer_start(timer, 1000000000, 0); - } + bpf_timer_start(timer, 1000000000, 0); return 0; }