Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Replace opencoded cpumask_next_wrap() in move_to_next_cpu()

The dedicated cpumask_next_wrap() is more verbose and effective than
cpumask_next() followed by cpumask_first().

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250605000651.45281-1-yury.norov@gmail.com
Signed-off-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Yury Norov and committed by
Steven Rostedt (Google)
88c79ecf d7b8f8e2

+1 -4
+1 -4
kernel/trace/trace_hwlat.c
··· 325 325 326 326 cpus_read_lock(); 327 327 cpumask_and(current_mask, cpu_online_mask, tr->tracing_cpumask); 328 - next_cpu = cpumask_next(raw_smp_processor_id(), current_mask); 328 + next_cpu = cpumask_next_wrap(raw_smp_processor_id(), current_mask); 329 329 cpus_read_unlock(); 330 - 331 - if (next_cpu >= nr_cpu_ids) 332 - next_cpu = cpumask_first(current_mask); 333 330 334 331 if (next_cpu >= nr_cpu_ids) /* Shouldn't happen! */ 335 332 goto change_mode;