Skip to content

Commit 51397dc

Browse files
committed
tracing: Quiet smp_processor_id() use in preemptable warning in hwlat
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. Link: https://lkml.kernel.org/r/20210804141848.79edadc0@oasis.local.home Acked-by: Daniel Bristot de Oliveira <bristot@redhat.com> Fixes: 8fa826b ("trace/hwlat: Implement the mode config option") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 1c0cec6 commit 51397dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/trace/trace_hwlat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static void move_to_next_cpu(void)
327327

328328
get_online_cpus();
329329
cpumask_and(current_mask, cpu_online_mask, tr->tracing_cpumask);
330-
next_cpu = cpumask_next(smp_processor_id(), current_mask);
330+
next_cpu = cpumask_next(raw_smp_processor_id(), current_mask);
331331
put_online_cpus();
332332

333333
if (next_cpu >= nr_cpu_ids)

0 commit comments

Comments
 (0)