Re: [PATCH v10 18/20] timers: Implement the hierarchical pull model

Frederic Weisbecker
2024-02-05T20:30:05Z

Le Mon, Feb 05, 2024 at 02:29:34PM +0100, Anna-Maria Behnsen a écrit :
> Anna-Maria Behnsen <anna-maria@linutronix.de> writes:
>
> > Frederic Weisbecker <frederic@kernel.org> writes:
> >
> >> Le Thu, Feb 01, 2024 at 05:15:37PM +0100, Anna-Maria Behnsen a écrit :
> >>> Frederic Weisbecker <frederic@kernel.org> writes:
> >>>
> >>> > Le Mon, Jan 15, 2024 at 03:37:41PM +0100, Anna-Maria Behnsen a écrit :
> >>> > Heh, I was about to say that it's impossible that timer_base_is_idle()
> >>> > at this stage but actually if we run in nohz_full...
> >>> >
> >>> > It happens so that nohz_full is deactivated until rcutree_online_cpu()
> >>> > which calls tick_dep_clear() but it's a pure coincidence that might
> >>> > disappear one day. So yes, let's keep it that way.
> >>>
> >>> I instrumented the code (with NOHZ FULL and NOHZ_IDLE) to make sure the
> >>> timer migration hierarchy state 'idle' is in sync with the timer base
> >>> 'idle'. And this was one part where it was possible that it runs out of
> >>> sync as I remember correctly. But if I understood you correctly, this
> >>> shouldn't happen at the moment?
> >>
> >> Well, it's not supposed to :-)
> >
> > Hmm, let me double check this and run the tests on the instrumented
> > version...
>
> I added a prinkt() to verify what I think I remember. I was able to see
> the prints. So it seems, that the coincidence that nohz_full is
> deactivated until rcutree_online_cpu() already disappeared.

Nice, then I guess it can become a WARN_ON.

Thanks.

>
> --- a/kernel/time/timer_migration.c
> +++ b/kernel/time/timer_migration.c
> @@ -1672,6 +1672,8 @@ static int tmigr_cpu_online(unsigned int
> tmc->idle = timer_base_is_idle();
> if (!tmc->idle)
> __tmigr_cpu_activate(tmc);
> + else
> + printk("TIMER BASE IS IDLE\n");
> tmc->online = true;
> raw_spin_unlock_irq(&tmc->lock);
> return 0;
>
> Thanks,
>
> Anna-Maria
>