Re: [PATCH v2] tick: shift tick_nohz_switch_to_nohz() from tick_check_oneshot_change() to hrtimer_run_queues()

From: Oleg Nesterov
Date: Mon Jun 03 2024 - 11:04:59 EST


On 06/03, Oleg Nesterov wrote:
>
> On 06/03, Thomas Gleixner wrote:
> >
> > On Sun, Jun 02 2024 at 12:20, Oleg Nesterov wrote:
> > > @@ -1891,8 +1891,11 @@ void hrtimer_run_queues(void)
> > > * there only sets the check bit in the tick_oneshot code,
> > > * otherwise we might deadlock vs. xtime_lock.
> > > */
> > > - if (tick_check_oneshot_change(!hrtimer_is_hres_enabled())) {
> > > - hrtimer_switch_to_hres();
> > > + if (tick_check_oneshot_change()) {
> > > + if (hrtimer_is_hres_enabled())
> > > + hrtimer_switch_to_hres();
> > > + else
> > > + tick_nohz_switch_to_nohz();
> >
> > hrtimers have no business with tick_nohz_switch_to_nohz(),
> > really. That's a strict tick/nohz specific thing. hrtimers do not care
> > about NOHZ much. They care about whether they can switch to high
> > resolution mode.
>
> OK, lets forget this patch then.
>
> But note that the comment above the tick_check_oneshot_change() says
> "switch to highres and / or nohz mode".

But yes, please forget this patch ;)

Currently hrtimer_run_queues() doesn't return if tick_check_oneshot_change()
itself calls tick_nohz_switch_to_nohz() and returns 0.

Oleg.