[PATCH 5/5] tracing/hwlat: Fix deadlock in cpuhp processing

2024-09-24 Thread Wei Li
ait_for_completion() | | cpus_read_lock() It constitutes ABBA deadlock indirectly between "cpu_hotplug_lock" and "hwlat_data.lock", make the mutex obtaining in kthread_fn() interruptible to fix this. Fixes: ba998f7d9531 ("trace/hwlat: Support hotplug operations

[PATCH 3/5] tracing/timerlat: Fix a race during cpuhp processing

2024-09-24 Thread Wei Li
perations") Signed-off-by: Wei Li --- kernel/trace/trace_osnoise.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index ddc9afb9b7d4..6ed4008e6d62 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@

[PATCH 2/5] tracing/timerlat: Drop interface_lock in stop_kthread()

2024-09-24 Thread Wei Li
) as it can take cpu_read_lock() again. Fixes: 5bfbcd1ee57b ("tracing/timerlat: Add interface_lock around clearing of kthread in stop_kthread()") Signed-off-by: Wei Li --- kernel/trace/trace_osnoise.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --g

[PATCH 4/5] tracing/hwlat: Fix a race during cpuhp processing

2024-09-24 Thread Wei Li
The cpuhp online/offline processing race also exists in percpu-mode hwlat tracer in theory, apply the fix too. Fixes: ba998f7d9531 ("trace/hwlat: Support hotplug operations") Signed-off-by: Wei Li --- kernel/trace/trace_hwlat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ke

[PATCH 1/5] tracing/timerlat: Fix duplicated kthread creation due to CPU online/offline

2024-09-24 Thread Wei Li
rt_kthread() to prevent this situation. Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations") Signed-off-by: Wei Li --- kernel/trace/trace_osnoise.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/t

[PATCH 0/5] tracing: Fix several deadlock/race issues in timerlat and hwlat tracer

2024-09-24 Thread Wei Li
e while true do echo hwlat > /sys/kernel/debug/tracing/current_tracer echo nop > /sys/kernel/debug/tracing/current_tracer done ``` Wei Li (5): tracing/timerlat: Fix duplicated kthread creation due to CPU online/offline tracing/timerlat: Drop interface_lock in stop_kthread()