Skip to content

Commit 6e65cf8

Browse files
Alexei Starovoitovanakryiko
authored andcommitted
selftests/bpf: Strengthen timer_start_deadlock test
Strengthen timer_start_deadlock test and check for recursion now Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20260204055147.54960-5-alexei.starovoitov@gmail.com
1 parent 6487330 commit 6e65cf8

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ SEC("tp_btf/hrtimer_cancel")
3131
int BPF_PROG(tp_hrtimer_cancel, struct hrtimer *hrtimer)
3232
{
3333
struct bpf_timer *timer;
34-
static bool called = false;
3534
int key = 0;
3635

3736
if (!in_timer_start)
@@ -42,13 +41,9 @@ int BPF_PROG(tp_hrtimer_cancel, struct hrtimer *hrtimer)
4241

4342
/*
4443
* Call bpf_timer_start() from the tracepoint within hrtimer logic
45-
* on the same timer to make sure it doesn't deadlock,
46-
* and do it once.
44+
* on the same timer to make sure it doesn't deadlock.
4745
*/
48-
if (!called) {
49-
called = true;
50-
bpf_timer_start(timer, 1000000000, 0);
51-
}
46+
bpf_timer_start(timer, 1000000000, 0);
5247
return 0;
5348
}
5449

0 commit comments

Comments
 (0)