* [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate
@ 2025-06-14 15:50 Yury Norov
2025-06-14 15:50 ` [PATCH 1/2] clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus() Yury Norov
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Yury Norov @ 2025-06-14 15:50 UTC (permalink / raw)
To: Thomas Gleixner, linux-kernel, John Stultz, Stephen Boyd
Cc: Yury Norov [NVIDIA]
From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
The dedicated API works better and improves on readability
Resend: drop 'fix opencoded...' wording (Tomas)
v2: https://lore.kernel.org/all/20250607141106.563924-1-yury.norov@gmail.com/
v1: https://lore.kernel.org/all/20250604232550.40491-1-yury.norov@gmail.com/
Yury Norov [NVIDIA] (2):
clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus()
clocksource: Use cpumask_next_wrap() in clocksource_watchdog()
kernel/time/clocksource.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus()
2025-06-14 15:50 [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate Yury Norov
@ 2025-06-14 15:50 ` Yury Norov
2025-06-14 18:16 ` [tip: timers/core] " tip-bot2 for Yury Norov [NVIDIA]
2025-06-14 15:50 ` [PATCH 2/2] clocksource: Use cpumask_next_wrap() in clocksource_watchdog() Yury Norov
2025-06-14 18:07 ` [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate Thomas Gleixner
2 siblings, 1 reply; 6+ messages in thread
From: Yury Norov @ 2025-06-14 15:50 UTC (permalink / raw)
To: Thomas Gleixner, linux-kernel, John Stultz, Stephen Boyd
Cc: Yury Norov [NVIDIA]
From: "Yury Norov [NVIDIA]" <yury.norov@gmail.com>
cpumask_any_but() is more verbose than cpumask_first() followed by
cpumask_next(). Use it in clocksource_verify_choose_cpus().
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
---
kernel/time/clocksource.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 6a8bc7da9062..a2f2e9f4d37b 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -323,9 +323,7 @@ static void clocksource_verify_choose_cpus(void)
return;
/* Make sure to select at least one CPU other than the current CPU. */
- cpu = cpumask_first(cpu_online_mask);
- if (cpu == smp_processor_id())
- cpu = cpumask_next(cpu, cpu_online_mask);
+ cpu = cpumask_any_but(cpu_online_mask, smp_processor_id());
if (WARN_ON_ONCE(cpu >= nr_cpu_ids))
return;
cpumask_set_cpu(cpu, &cpus_chosen);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] clocksource: Use cpumask_next_wrap() in clocksource_watchdog()
2025-06-14 15:50 [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate Yury Norov
2025-06-14 15:50 ` [PATCH 1/2] clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus() Yury Norov
@ 2025-06-14 15:50 ` Yury Norov
2025-06-14 18:16 ` [tip: timers/core] " tip-bot2 for Yury Norov [NVIDIA]
2025-06-14 18:07 ` [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate Thomas Gleixner
2 siblings, 1 reply; 6+ messages in thread
From: Yury Norov @ 2025-06-14 15:50 UTC (permalink / raw)
To: Thomas Gleixner, linux-kernel, John Stultz, Stephen Boyd
Cc: Yury Norov [NVIDIA]
From: "Yury Norov [NVIDIA]" <yury.norov@gmail.com>
cpumask_next_wrap() is more verbose and efficient comparing to
cpumask_next() followed by cpumask_first().
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
---
kernel/time/clocksource.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index a2f2e9f4d37b..e400fe150f9d 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -587,9 +587,7 @@ static void clocksource_watchdog(struct timer_list *unused)
* Cycle through CPUs to check if the CPUs stay synchronized
* to each other.
*/
- next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
- if (next_cpu >= nr_cpu_ids)
- next_cpu = cpumask_first(cpu_online_mask);
+ next_cpu = cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask);
/*
* Arm timer if not already pending: could race with concurrent
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate
2025-06-14 15:50 [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate Yury Norov
2025-06-14 15:50 ` [PATCH 1/2] clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus() Yury Norov
2025-06-14 15:50 ` [PATCH 2/2] clocksource: Use cpumask_next_wrap() in clocksource_watchdog() Yury Norov
@ 2025-06-14 18:07 ` Thomas Gleixner
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2025-06-14 18:07 UTC (permalink / raw)
To: Yury Norov, linux-kernel, John Stultz, Stephen Boyd; +Cc: Yury Norov [NVIDIA]
On Sat, Jun 14 2025 at 11:50, Yury Norov wrote:
> From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
>
> The dedicated API works better and improves on readability
>
> Resend: drop 'fix opencoded...' wording (Tomas)
This is not a resend as you changed the change log, so it's V3.
Resend is only for unmodified versions where you got no feedback and did
not change anything.
And in the RESEND case you have to keep the version number so stuff can
be identified as resend of a particular version.
People have scripts which depend on submitters following the
rules. Chasing stuff by hand is just waste of time.
Thanks,
tglx
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tip: timers/core] clocksource: Use cpumask_next_wrap() in clocksource_watchdog()
2025-06-14 15:50 ` [PATCH 2/2] clocksource: Use cpumask_next_wrap() in clocksource_watchdog() Yury Norov
@ 2025-06-14 18:16 ` tip-bot2 for Yury Norov [NVIDIA]
0 siblings, 0 replies; 6+ messages in thread
From: tip-bot2 for Yury Norov [NVIDIA] @ 2025-06-14 18:16 UTC (permalink / raw)
To: linux-tip-commits
Cc: Yury Norov [NVIDIA], Thomas Gleixner, John Stultz, x86,
linux-kernel
The following commit has been merged into the timers/core branch of tip:
Commit-ID: bfa788dc2ddaea7d7930f63a5c7c8f3668a3f2c5
Gitweb: https://git.kernel.org/tip/bfa788dc2ddaea7d7930f63a5c7c8f3668a3f2c5
Author: Yury Norov [NVIDIA] <yury.norov@gmail.com>
AuthorDate: Sat, 14 Jun 2025 11:50:30 -04:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Sat, 14 Jun 2025 20:09:44 +02:00
clocksource: Use cpumask_next_wrap() in clocksource_watchdog()
cpumask_next_wrap() is more verbose and efficient comparing to
cpumask_next() followed by cpumask_first().
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/all/20250614155031.340988-3-yury.norov@gmail.com
---
kernel/time/clocksource.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index a2f2e9f..e400fe1 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -587,9 +587,7 @@ static void clocksource_watchdog(struct timer_list *unused)
* Cycle through CPUs to check if the CPUs stay synchronized
* to each other.
*/
- next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
- if (next_cpu >= nr_cpu_ids)
- next_cpu = cpumask_first(cpu_online_mask);
+ next_cpu = cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask);
/*
* Arm timer if not already pending: could race with concurrent
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [tip: timers/core] clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus()
2025-06-14 15:50 ` [PATCH 1/2] clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus() Yury Norov
@ 2025-06-14 18:16 ` tip-bot2 for Yury Norov [NVIDIA]
0 siblings, 0 replies; 6+ messages in thread
From: tip-bot2 for Yury Norov [NVIDIA] @ 2025-06-14 18:16 UTC (permalink / raw)
To: linux-tip-commits
Cc: Yury Norov [NVIDIA], Thomas Gleixner, John Stultz, x86,
linux-kernel
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 4fa7d61d5a02ad57a05c69365db293afddf678fc
Gitweb: https://git.kernel.org/tip/4fa7d61d5a02ad57a05c69365db293afddf678fc
Author: Yury Norov [NVIDIA] <yury.norov@gmail.com>
AuthorDate: Sat, 14 Jun 2025 11:50:29 -04:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Sat, 14 Jun 2025 20:09:44 +02:00
clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus()
cpumask_any_but() is more verbose than cpumask_first() followed by
cpumask_next(). Use it in clocksource_verify_choose_cpus().
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/all/20250614155031.340988-2-yury.norov@gmail.com
---
kernel/time/clocksource.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 6a8bc7d..a2f2e9f 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -323,9 +323,7 @@ static void clocksource_verify_choose_cpus(void)
return;
/* Make sure to select at least one CPU other than the current CPU. */
- cpu = cpumask_first(cpu_online_mask);
- if (cpu == smp_processor_id())
- cpu = cpumask_next(cpu, cpu_online_mask);
+ cpu = cpumask_any_but(cpu_online_mask, smp_processor_id());
if (WARN_ON_ONCE(cpu >= nr_cpu_ids))
return;
cpumask_set_cpu(cpu, &cpus_chosen);
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-14 18:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-14 15:50 [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate Yury Norov
2025-06-14 15:50 ` [PATCH 1/2] clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus() Yury Norov
2025-06-14 18:16 ` [tip: timers/core] " tip-bot2 for Yury Norov [NVIDIA]
2025-06-14 15:50 ` [PATCH 2/2] clocksource: Use cpumask_next_wrap() in clocksource_watchdog() Yury Norov
2025-06-14 18:16 ` [tip: timers/core] " tip-bot2 for Yury Norov [NVIDIA]
2025-06-14 18:07 ` [PATCH RESEND 0/2] clocksource: Use better cpumask API where appropriate Thomas Gleixner
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.