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

From: Thomas Gleixner
Date: Mon Jun 03 2024 - 04:15:00 EST


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.

Thanks,

tglx