Re: [tip: timers/urgent] timekeeping: Use READ/WRITE_ONCE() for tick_do_timer_cpu

Ingo Molnar
2024-04-10T08:15:09Z

* tip-bot2 for Thomas Gleixner <tip-bot2@linutronix.de> wrote:

> The following commit has been merged into the timers/urgent branch of tip:
>
> Commit-ID: 0200ddd723d6056d0b1c1ebde4b11e75a0f2ed7e
> Gitweb: https://git.kernel.org/tip/0200ddd723d6056d0b1c1ebde4b11e75a0f2ed7e
> Author: Thomas Gleixner <tglx@linutronix.de>
> AuthorDate: Tue, 09 Apr 2024 12:29:12 +02:00
> Committer: Thomas Gleixner <tglx@linutronix.de>
> CommitterDate: Tue, 09 Apr 2024 23:09:44 +02:00
>
> timekeeping: Use READ/WRITE_ONCE() for tick_do_timer_cpu

> @@ -232,7 +233,7 @@ static void tick_setup_device(struct tick_device *td,
> !tick_nohz_full_cpu(cpu)) {
> tick_take_do_timer_from_boot();
> tick_do_timer_boot_cpu = -1;
> - WARN_ON(tick_do_timer_cpu != cpu);
> + WARN_ON(READ_ON_ONCE(tick_do_timer_cpu) != cpu);

So there's no such thing as READ_ON_ONCE() - I've amended the commit with
the fix below.

Thanks,

Ingo

kernel/time/tick-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index a285f4deb96d..d88b13076b79 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -233,7 +233,7 @@ static void tick_setup_device(struct tick_device *td,
!tick_nohz_full_cpu(cpu)) {
tick_take_do_timer_from_boot();
tick_do_timer_boot_cpu = -1;
- WARN_ON(READ_ON_ONCE(tick_do_timer_cpu) != cpu);
+ WARN_ON(READ_ONCE(tick_do_timer_cpu) != cpu);
#endif
}