public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tracing: Fix deadlock in hwlat tracer
@ 2024-11-21  2:18 Wei Li
  2024-11-21  2:18 ` [PATCH v2 1/2] tracing: Allow custom read/write processing in trace_min_max_{write,read}() Wei Li
  2024-11-21  2:18 ` [PATCH v2 2/2] tracing/hwlat: Fix deadlock in cpuhp processing Wei Li
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Li @ 2024-11-21  2:18 UTC (permalink / raw)
  To: linux-trace-kernel
  Cc: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, xiexiuqi

This patchset fixes a deadlock issue found in concurrent CPU-hotplug and
tracer-toggling testing:

Background: *test_hotplug.sh*
```
#!/bin/sh

while true
do
	echo 0 > /sys/devices/system/cpu/cpu1/online
	echo 1 > /sys/devices/system/cpu/cpu1/online
done
```

Test: *test_hwlat.sh*
```
#!/bin/sh

echo per-cpu > /sys/kernel/debug/tracing/hwlat_detector/mode
while true
do
	echo hwlat > /sys/kernel/debug/tracing/current_tracer
	echo nop > /sys/kernel/debug/tracing/current_tracer
done
```

v1 -> v2:
 - The previous solution try to make the mutex obtaining in kthread_fn()
 interruptible to fix this issue. To make the logic clearer, change to
 remove the mutex_lock in this version. 

Links:
 v1: https://lore.kernel.org/linux-trace-kernel/20240924094515.3561410-6-liwei391@huawei.com/

Wei Li (2):
  tracing: Allow custom read/write processing in
    trace_min_max_{write,read}()
  tracing/hwlat: Fix deadlock in cpuhp processing

 kernel/trace/trace.c       | 13 ++++++++++---
 kernel/trace/trace.h       |  2 ++
 kernel/trace/trace_hwlat.c | 15 +++++++++++----
 3 files changed, 23 insertions(+), 7 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-11  3:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-21  2:18 [PATCH v2 0/2] tracing: Fix deadlock in hwlat tracer Wei Li
2024-11-21  2:18 ` [PATCH v2 1/2] tracing: Allow custom read/write processing in trace_min_max_{write,read}() Wei Li
2024-12-11  3:56   ` Steven Rostedt
2024-11-21  2:18 ` [PATCH v2 2/2] tracing/hwlat: Fix deadlock in cpuhp processing Wei Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox