Commit 6e65cf81 authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by Andrii Nakryiko
Browse files

selftests/bpf: Strengthen timer_start_deadlock test



Strengthen timer_start_deadlock test and check for recursion now

Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260204055147.54960-5-alexei.starovoitov@gmail.com
parent 64873307
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -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);
	}
	return 0;
}