Re: sched/isolation: tick_take_do_timer_from_boot() calls smp_call_function_single() with irqs disabled

From: Oleg Nesterov
Date: Fri May 24 2024 - 14:38:42 EST


Frederic. Thanks for looking at this!

I've already had a few beers today, I know I'll regret about this email
tomorrow, but I can't resist ;)

On 05/24, Frederic Weisbecker wrote:
>
> Actually... The boot CPU is nohz_full and nothing prevents it
> from stopping its tick once IRQs are enabled and before calling
> tick_nohz_idle_enter(). When that happens, tick_nohz_full_update_tick()
> doesn't go through can_stop_idle_tick() and therefore doesn't check if it
> is the timekeeper. And then it goes through tick_nohz_stop_tick() which
> can set tick_do_timer_cpu = TICK_DO_TIMER_NONE.

Heh. May be you mean, say, tick_nohz_full_update_tick() or
tick_nohz_idle_update_tick() which check tick_nohz_full_cpu(cpu).
Yes this doesn't help during the boot, and this was another source for
confusion to me.

But again, again. tick_sched_do_timer() says

* If nohz_full is enabled, this should not happen because the
* 'tick_do_timer_cpu' CPU never relinquishes.

so I guess it is not supposed to happen?

And. My main question was: how can smp_call_function_single() help???
Why do we actually need it?

Thanks ;)

Oleg.