From: Avi Weiss <thnkslprpt@gmail.com>
To: Anna-Maria Behnsen <anna-maria@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Thomas Gleixner <tglx@kernel.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
linux-kernel@vger.kernel.org, Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] hrtimer: Retrigger local timers after clock changes
Date: Sun, 1 Nov 2026 16:15:53 +0200 [thread overview]
Message-ID: <20261101141552.644764-2-thnkslprpt@gmail.com> (raw)
clock_was_set() selects CPUs whose hrtimer deadlines move earlier
after a clock change. smp_call_function_many() excludes the calling
CPU even when it is in the mask, leaving its clock event programmed
for the old deadline. An overdue realtime timer can then expire
only when a later event triggers timer handling.
Use on_each_cpu_mask() to retrigger the local CPU when selected,
without interrupting CPUs with unaffected deadlines.
Fixes: 81d741d3460c ("hrtimer: Avoid unnecessary SMP function calls in clock_was_set()")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
kernel/time/hrtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 17dd38a6cee7..3133d7403a74 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1000,7 +1000,7 @@ void clock_was_set(unsigned int bases)
cpumask_set_cpu(cpu, mask);
}
scoped_guard(preempt)
- smp_call_function_many(mask, retrigger_next_event, NULL, 1);
+ on_each_cpu_mask(mask, retrigger_next_event, NULL, 1);
}
free_cpumask_var(mask);
base-commit: d135ab453a7400a34930bdda1ef4bdc8acfac80e
--
2.43.0
reply other threads:[~2026-11-01 14:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261101141552.644764-2-thnkslprpt@gmail.com \
--to=thnkslprpt@gmail.com \
--cc=anna-maria@linutronix.de \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=tglx@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®