Home
last modified time | relevance | path

Searched hist:"0 a5d2efa382751fc2b0a9a82f6cbdfe8aef29fb3" (Results 1 – 2 of 2) sorted by relevance

/linux/tools/testing/selftests/bpf/progs/
H A Dfree_timer.c0a5d2efa382751fc2b0a9a82f6cbdfe8aef29fb3 Fri Jan 17 11:18:16 CET 2025 Hou Tao <houtao1@huawei.com> selftests/bpf: Add test case for the freeing of bpf_timer

The main purpose of the test is to demonstrate the lock problem for the
free of bpf_timer under PREEMPT_RT. When freeing a bpf_timer which is
running on other CPU in bpf_timer_cancel_and_free(), hrtimer_cancel()
will try to acquire a spin-lock (namely softirq_expiry_lock), however
the freeing procedure has already held a raw-spin-lock.

The test first creates two threads: one to start timers and the other to
free timers. The start-timers thread will start the timer and then wake
up the free-timers thread to free these timers when the starts complete.
After freeing, the free-timer thread will wake up the start-timer thread
to complete the current iteration. A loop of 10 iterations is used.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250117101816.2101857-6-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
/linux/tools/testing/selftests/bpf/prog_tests/
H A Dfree_timer.c0a5d2efa382751fc2b0a9a82f6cbdfe8aef29fb3 Fri Jan 17 11:18:16 CET 2025 Hou Tao <houtao1@huawei.com> selftests/bpf: Add test case for the freeing of bpf_timer

The main purpose of the test is to demonstrate the lock problem for the
free of bpf_timer under PREEMPT_RT. When freeing a bpf_timer which is
running on other CPU in bpf_timer_cancel_and_free(), hrtimer_cancel()
will try to acquire a spin-lock (namely softirq_expiry_lock), however
the freeing procedure has already held a raw-spin-lock.

The test first creates two threads: one to start timers and the other to
free timers. The start-timers thread will start the timer and then wake
up the free-timers thread to free these timers when the starts complete.
After freeing, the free-timer thread will wake up the start-timer thread
to complete the current iteration. A loop of 10 iterations is used.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250117101816.2101857-6-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>