mbox series

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

Message ID 20240924094515.3561410-1-liwei391@huawei.com (mailing list archive)
Headers show
Series tracing: Fix several deadlock/race issues in timerlat and hwlat tracer | expand

Message

Wei Li Sept. 24, 2024, 9:45 a.m. UTC
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(-)

Comments

Steven Rostedt Sept. 26, 2024, 12:57 p.m. UTC | #1
Daniel, is unfortunately no longer the maintainer of this code:

  https://lwn.net/Articles/979912/

I'll try to take a look at this next week.

Thanks,

-- Steve


On Tue, 24 Sep 2024 17:45:10 +0800
Wei Li <liwei391@huawei.com> wrote:

> 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(-)
>