Commit 1f98857
tracing: Fix potential deadlock in cpu hotplug with osnoise
The following sequence may leads deadlock in cpu hotplug:
task1 task2 task3
----- ----- -----
mutex_lock(&interface_lock)
[CPU GOING OFFLINE]
cpus_write_lock();
osnoise_cpu_die();
kthread_stop(task3);
wait_for_completion();
osnoise_sleep();
mutex_lock(&interface_lock);
cpus_read_lock();
[DEAD LOCK]
Fix by swap the order of cpus_read_lock() and mutex_lock(&interface_lock).
Cc: [email protected]
Cc: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Fixes: bce29ac ("trace: Add osnoise tracer")
Link: https://patch.msgid.link/[email protected]
Reviewed-by: Masami Hiramatsu (Google) <[email protected]>
Signed-off-by: Luo Haiyang <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>1 parent 50b35c9 commit 1f98857
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2073 | 2073 | | |
2074 | 2074 | | |
2075 | 2075 | | |
2076 | | - | |
2077 | 2076 | | |
| 2077 | + | |
2078 | 2078 | | |
2079 | 2079 | | |
2080 | 2080 | | |
| |||
2237 | 2237 | | |
2238 | 2238 | | |
2239 | 2239 | | |
2240 | | - | |
2241 | 2240 | | |
2242 | 2241 | | |
2243 | 2242 | | |
2244 | 2243 | | |
| 2244 | + | |
2245 | 2245 | | |
2246 | 2246 | | |
2247 | 2247 | | |
| |||
2257 | 2257 | | |
2258 | 2258 | | |
2259 | 2259 | | |
2260 | | - | |
2261 | 2260 | | |
| 2261 | + | |
2262 | 2262 | | |
2263 | 2263 | | |
2264 | 2264 | | |
| |||
2345 | 2345 | | |
2346 | 2346 | | |
2347 | 2347 | | |
2348 | | - | |
2349 | 2348 | | |
2350 | 2349 | | |
2351 | 2350 | | |
2352 | 2351 | | |
| 2352 | + | |
2353 | 2353 | | |
2354 | 2354 | | |
2355 | 2355 | | |
2356 | | - | |
2357 | 2356 | | |
| 2357 | + | |
2358 | 2358 | | |
2359 | 2359 | | |
2360 | 2360 | | |
| |||
0 commit comments