tracing: Quiet smp_processor_id() use in preemptable warning in hwlat
Subsystems (2)
Steven Rostedt
maintainerPATCH 1/1 tracing: Quiet smp_processor_id() use in preemptable warning in hwlat
From: "Steven Rostedt (VMware)" <[email protected]>
The hardware latency detector (hwlat) has a mode that it runs one thread across CPUs. The logic to move from the currently running CPU to the next one in the list does a smp_processor_id() to find where it currently is. Unfortunately, it's done with preemption enabled, and this triggers a warning for using smp_processor_id() in a preempt enabled section.
As it is only using smp_processor_id() to get information on where it currently is in order to simply move it to the next CPU, it doesn't really care if it got moved in the mean time. It will simply balance out later if such a case arises.
Switch smp_processor_id() to raw_smp_processor_id() to quiet that warning.
--- kernel/trace/trace_hwlat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_hwlat.c +1 -1
@@ -327,7 +327,7 @@ static void move_to_next_cpu(void)get_online_cpus ();cpumask_and (current_mask, cpu_online_mask, tr->tracing_cpumask); - next_cpu =cpumask_next (smp_processor_id (), current_mask); + next_cpu =cpumask_next (raw_smp_processor_id (), current_mask);put_online_cpus ();if (next_cpu >= nr_cpu_ids)
Signature · 1 line
2.31.1
Quoted 13 lines · Steven Rostedt
From: "Steven Rostedt (VMware)" <[email protected]>
The hardware latency detector (hwlat) has a mode that it runs one thread across CPUs. The logic to move from the currently running CPU to the next one in the list does a
smp_processor_id()to find where it currently is. Unfortunately, it's done with preemption enabled, and this triggers a warning for usingsmp_processor_id()in a preempt enabled section.As it is only using
smp_processor_id()to get information on where it currently is in order to simply move it to the next CPU, it doesn't really care if it got moved in the mean time. It will simply balance out later if such a case arises.
Quoted 4 lines
Switch
smp_processor_id()toraw_smp_processor_id()to quiet that warning.Fixes 8fa826b7344d ("trace/hwlat: Implement the mode config option")Signed-off-by Steven Rostedt (VMware) <[email protected]>
Thanks!
-- Daniel
Quoted 18 lines
--- kernel/trace/trace_hwlat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/trace/trace_hwlat.c +1
-1@@ -327,7 +327,7 @@ static void move_to_next_cpu(void)get_online_cpus ();cpumask_and (current_mask, cpu_online_mask, tr->tracing_cpumask); - next_cpu =cpumask_next (smp_processor_id (), current_mask); + next_cpu =cpumask_next (raw_smp_processor_id (), current_mask);put_online_cpus ();if (next_cpu >= nr_cpu_ids)