The cpuhp online/offline processing race also exists in percpu-mode hwlat tracer in theory, apply the fix too. That is: T1 | T2 [CPUHP_ONLINE] | cpu_device_down() hwlat_hotplug_workfn() | | cpus_write_lock() | takedown_cpu(1) | cpus_write_unlock() [CPUHP_OFFLINE] | cpus_read_lock() | start_kthread(1) | cpus_read_unlock() |
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -520,6 +520,8 @@ static void hwlat_hotplug_workfn(struct work_struct *dummy) · 519 unmodified lines | |||
| 520 | if (!hwlat_busy || hwlat_data.thread_mode != MODE_PER_CPU) | 520 | if (!hwlat_busy || hwlat_data.thread_mode != MODE_PER_CPU) |
| 521 | goto out_unlock; | 521 | goto out_unlock; |
| 522 | 522 | ||
| 523 | if (!cpu_online(cpu)) | ||
| 524 | goto out_unlock; | ||
| 523 | if (!cpumask_test_cpu(cpu, tr->tracing_cpumask)) | 525 | if (!cpumask_test_cpu(cpu, tr->tracing_cpumask)) |
| 524 | goto out_unlock; | 526 | goto out_unlock; |
| 525 | 527 | ||