From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
Yury Norov <yury.norov@gmail.com>
Subject: [for-next][PATCH 1/8] tracing: Replace opencoded cpumask_next_wrap() in move_to_next_cpu()
Date: Wed, 23 Jul 2025 10:49:08 -0400 [thread overview]
Message-ID: <20250723144927.507197150@kernel.org> (raw)
In-Reply-To: 20250723144907.219256132@kernel.org
From: Yury Norov <yury.norov@gmail.com>
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 | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index b65353ec2837..2f7b94e98317 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -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;
--
2.47.2
next prev parent reply other threads:[~2025-07-23 15:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 14:49 [for-next][PATCH 0/8] tracing: Updates for v6.17 Steven Rostedt
2025-07-23 14:49 ` Steven Rostedt [this message]
2025-07-23 14:49 ` [for-next][PATCH 2/8] tracing: Use queue_rcu_work() to free filters Steven Rostedt
2025-07-23 14:49 ` [for-next][PATCH 3/8] kernel: trace: preemptirq_delay_test: use offstack cpu mask Steven Rostedt
2025-07-23 14:49 ` [for-next][PATCH 4/8] tracing/sched: Remove obsolete comment on suffixes Steven Rostedt
2025-07-23 14:49 ` [for-next][PATCH 5/8] tracing: Remove pointless memory barriers Steven Rostedt
2025-07-23 14:49 ` [for-next][PATCH 6/8] tracing: Remove EVENT_FILE_FL_SOFT_MODE flag Steven Rostedt
2025-07-23 14:49 ` [for-next][PATCH 7/8] tracing: Fix comment in trace_module_remove_events() Steven Rostedt
2025-07-23 14:49 ` [for-next][PATCH 8/8] tracing: Deprecate auto-mounting tracefs in debugfs Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250723144927.507197150@kernel.org \
--to=rostedt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.