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

Thomas Gleixner
2024-05-24T17:16:21Z

On Fri, May 24 2024 at 17:20, Frederic Weisbecker wrote:
> Le Fri, May 24, 2024 at 11:31:12AM +0200, Thomas Gleixner a écrit :
>> >> Race with tick_nohz_stop_tick() on boot CPU which can set
>> >> tick_do_timer_cpu = TICK_DO_TIMER_NONE? Is it really bad?
>>
>> This can't happen.
>
> 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.

OMG...