Skip to content

tracing: Fix several deadlock/race issues in timerlat and hwlat tracer

Wei Li linux-trace-kernel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5tracing/timerlat: Fix duplicated kthread creation due to CPU online/offlinekernel/trace/trace_osnoise.c+5 -20 replies
2/5tracing/timerlat: Drop interface_lock in stop_kthread()kernel/trace/trace_osnoise.c+6 -70 replies
3/5tracing/timerlat: Fix a race during cpuhp processingkernel/trace/trace_osnoise.c+2 -00 replies
4/5tracing/hwlat: Fix a race during cpuhp processingkernel/trace/trace_hwlat.c+2 -00 replies
5/5tracing/hwlat: Fix deadlock in cpuhp processingkernel/trace/trace_hwlat.c+2 -14 replies

Reviews trailers per patch

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

Read the v1 thread

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

These issues are found in concurrent CPU-hotplug and tracer-toggling testing, the test cases are as follows:

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 1: *test_timerlat.sh*

```
#!/bin/sh

while true
do
	echo timerlat > /sys/kernel/debug/tracing/current_tracer
	echo nop > /sys/kernel/debug/tracing/current_tracer
done
```

Test 2: *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
```

Wei Li (5):
tracing/timerlat: Fix duplicated kthread creation due to CPU
online/offline
tracing/timerlat: Drop interface_lock in stop_kthread() tracing/timerlat: Fix a race during cpuhp processing tracing/hwlat: Fix a race during cpuhp processing tracing/hwlat: Fix deadlock in cpuhp processing

 kernel/trace/trace_hwlat.c   |  5 ++++-
 kernel/trace/trace_osnoise.c | 22 +++++++++++++---------
 2 files changed, 17 insertions(+), 10 deletions(-)
Signature · 1 line
2.25.1