Skip to contentSkip to conversation

trace: fix opencoded cpumask_next_wrap() in move_to_next_cpu()

PATCH New Yury Norov 1 participant 1 message Jun 5, 2025

Subsystems (2)
lore
Share & tools
lore

Yury Norov

author
#0 lore raw

PATCH 1/1 trace: fix 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().

---
 kernel/trace/trace_hwlat.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
kernel/trace/trace_hwlat.c +1 -4
index b65353ec2837..2f7b94e98317 100644
@@ -325,12 +325,9 @@ static void move_to_next_cpu(void)
 
 	cpus_read_lock();
 	cpumask_and(current_mask, cpu_online_mask, tr->tracing_cpumask);
-	next_cpu = cpumask_next(raw_smp_processor_id(), current_mask);
+	next_cpu = cpumask_next_wrap(raw_smp_processor_id(), current_mask);
 	cpus_read_unlock();
 
-	if (next_cpu >= nr_cpu_ids)
-		next_cpu = cpumask_first(current_mask);
-
 	if (next_cpu >= nr_cpu_ids) /* Shouldn't happen! */
 		goto change_mode;
 
Signature · 1 line
2.43.0