From: Frederic Weisbecker <frederic@kernel.org>
To: Usama Arif <usamaarif642@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
vlad.wing@gmail.com, rcu@vger.kernel.org, boqun.feng@gmail.com,
joel@joelfernandes.org, neeraj.upadhyay@amd.com,
urezki@gmail.com, qiang.zhang1211@gmail.com,
Cheng-Jui.Wang@mediatek.com, leitao@debian.org,
kernel-team@meta.com, paulmck@kernel.org,
Anna-Maria Behnsen <anna-maria@linutronix.de>
Subject: Re: [PATCH 1/3] hrtimers: Force migrate away hrtimers queued after CPUHP_AP_HRTIMERS_DYING
Date: Sat, 21 Dec 2024 00:43:17 +0100 [thread overview]
Message-ID: <Z2YBFQ_WNm60HTx4@pavilion.home> (raw)
In-Reply-To: <b2d31c28-96c4-4762-a0b4-686713bc6778@gmail.com>
Le Thu, Dec 19, 2024 at 10:00:12PM +0300, Usama Arif a écrit :
> > @@ -1240,6 +1280,12 @@ static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
> >
> > hrtimer_set_expires_range_ns(timer, tim, delta_ns);
> >
> > + if (unlikely(!this_cpu_base->online)) {
> > + enqueue_hrtimer_offline(timer, base, mode);
>
> Thanks for the fix!
>
> It looks good to me, maybe as a follow up, we could rename switch_hrtimer_base to
> enqueue_hrtimer_local? (or maybe something more appropriate)
> There are now 2 different paths that switch hrtimer base (enqueue_hrtimer_offline and
> switch_hrtimer_base).
I considered extending switch_hrtimer_base() instead to handle offline
CPU from there but that turned out ugly since what follows assumes to either
queue locally and possibly reprogram or queue remotely and not reprogram.
enqueue_hrtimer_global() does only enqueue remotely and possibly
trigger a reprogram.
And indeed we could move switch_hrtimer_base() + enqueue_hrtimer() +
hrtimer_force_reprogram() to a enqueue_hrtimer_online() for example.
Perhaps that would clarify things a bit, I don't know...
Thanks.
>
> > + return 0;
> > + }
> > +
> > +
> nit: extra new line above.
> > /* Switch the timer base, if necessary: */
> > if (!force_local) {
> > new_base = switch_hrtimer_base(timer, base,
>
next prev parent reply other threads:[~2024-12-20 23:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 16:50 [PATCH 0/3] hrtimer: Fix timers queued locally from offline CPUs Frederic Weisbecker
2024-12-18 16:50 ` [PATCH 1/3] hrtimers: Force migrate away hrtimers queued after CPUHP_AP_HRTIMERS_DYING Frederic Weisbecker
2024-12-19 19:00 ` Usama Arif
2024-12-20 23:43 ` Frederic Weisbecker [this message]
2024-12-18 16:50 ` [PATCH 2/3] rcu: Remove swake_up_one_online() bandaid Frederic Weisbecker
2024-12-18 16:50 ` [PATCH 3/3] Revert "rcu/nocb: Fix rcuog wake-up from offline softirq" Frederic Weisbecker
2024-12-19 17:42 ` [PATCH 0/3] hrtimer: Fix timers queued locally from offline CPUs Paul E. McKenney
2024-12-20 23:19 ` Paul E. McKenney
2024-12-20 23:26 ` Frederic Weisbecker
2024-12-21 0:05 ` Paul E. McKenney
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=Z2YBFQ_WNm60HTx4@pavilion.home \
--to=frederic@kernel.org \
--cc=Cheng-Jui.Wang@mediatek.com \
--cc=anna-maria@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=joel@joelfernandes.org \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neeraj.upadhyay@amd.com \
--cc=paulmck@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=rcu@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=urezki@gmail.com \
--cc=usamaarif642@gmail.com \
--cc=vlad.wing@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.