[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250923081858.GU4068168@noisy.programming.kicks-ass.net>
Date: Tue, 23 Sep 2025 10:18:58 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: arnd@...db.de, anna-maria@...utronix.de, frederic@...nel.org,
luto@...nel.org, mingo@...hat.com, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
vschneid@...hat.com, linux-kernel@...r.kernel.org,
oliver.sang@...el.com
Subject: Re: [RFC][PATCH 7/8] entry,hrtimer: Push reprogramming timers into
the interrupt return path
On Tue, Sep 23, 2025 at 09:52:40AM +0200, Peter Zijlstra wrote:
> > 2) I came up with the following scenario, which is broken with this
> > delayed rearm.
> >
> > Assume this happens on the timekeeping CPU.
> >
> > hrtimer_interrupt()
> > expire_timers();
> > set(TIF_REARM);
> >
> > exit_to_user_mode_prepare()
> > handle_tif_muck()
> > ...
> > to = jiffies + 2;
> > while (!cond() && time_before(jiffies, to))
> > relax();
> >
> > If cond() does not become true for whatever reason, then this won't
> > make progress ever because the tick hrtimer which increments
> > jiffies is not happening.
> >
> > It can also be a wait on a remote CPU preventing progress
> > indirectly or a subtle dependency on a timer (timer list or
> > hrtimer) to expire.
> >
> > I have no idea whether that's related to the reported 0-day fallout,
> > but it definitely is a real problem lurking in the dark.
>
> Argh... that exit_to_user_mode_loop() thing enables IRQs. Yes, buggered
> something mighty.
>
> Let me haz a poke.
Bah. So schedule() is first in the TIF loop. Delaying hrtimer_rearm()
until that first schedule() call might just be enough, but that also
means running all of sched_submit_work() without timers... it might just
work, but urgh.
Let me try that anyway. I'll push it out to the robot, we'll see what
happens.
Powered by blists - more mailing lists