]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tracing: Replace opencoded cpumask_next_wrap() in move_to_next_cpu()
authorYury Norov <yury.norov@gmail.com>
Thu, 5 Jun 2025 00:06:50 +0000 (20:06 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 8 Jul 2025 22:17:29 +0000 (18:17 -0400)
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>
kernel/trace/trace_hwlat.c

index b65353ec2837cbe11e103352b099be72e1c77ebc..2f7b94e98317cb01a33aaa839b6b52f3a261573f 100644 (file)
@@ -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;