Skip to content

tracing: Fix deadlock in hwlat tracer

Wei Li linux-trace-kernel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 1 replyIn review

Changes in v2 from the cover letter

- 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.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tracing: Allow custom read/write processing in trace_min_max_{write,read}()kernel/trace/trace.c kernel/trace/trace.h+12 -31 reply
2/2tracing/hwlat: Fix deadlock in cpuhp processingkernel/trace/trace_hwlat.c+11 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] tracing: Fix deadlock in hwlat tracer

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/[email protected]/

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(-)
Signature · 1 line
2.25.1