From: Frederic Weisbecker <frederic@kernel.org>
To: Avi Weiss <thnkslprpt@gmail.com>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>,
Thomas Gleixner <tglx@kernel.org>,
Marcelo Tosatti <mtosatti@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hrtimer: Retrigger local timers after clock changes
Date: Tue, 3 Nov 2026 16:01:08 +0100 [thread overview]
Message-ID: <aun3NCjn7dcdghCy@localhost.localdomain> (raw)
In-Reply-To: <20261101141552.644764-2-thnkslprpt@gmail.com>
Le Sun, Nov 01, 2026 at 04:15:53PM +0200, Avi Weiss a écrit :
> 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);
Heh, this API is so error prone... If it really doesn't want to call on the
local CPU (for some undescribed reason), it should at least be renamed to
smp_call_function_many_butself().
> + on_each_cpu_mask(mask, retrigger_next_event, NULL, 1);
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
--
Frederic Weisbecker
SUSE Labs
prev parent reply other threads:[~2026-11-03 15:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 14:15 Avi Weiss
2026-11-03 15:01 ` Frederic Weisbecker [this message]
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=aun3NCjn7dcdghCy@localhost.localdomain \
--to=frederic@kernel.org \
--cc=anna-maria@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=tglx@kernel.org \
--cc=thnkslprpt@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 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®