Re: [PATCH] tick/broadcast-hrtimer: Prevent the timer device on broadcast duty CPU from being disabled
From: Yu Liao
Date: Thu Jul 11 2024 - 09:11:46 EST
Hi Thomas,
Sorry it took so long to reply.
On 2024/1/25 3:18, Thomas Gleixner wrote:
>> + if (tick_check_broadcast_expired() && expires >= next_event)
>> + tick_program_event(next_event, 1);
>
> I'm not really enthused about another conditional here and that
> condition is more than obscure.
>
> The problem is that the local clockevent might be shut down, right?
>
> So checking for that state is the right thing to do and the proper place
> is in hotplug_cpu__broadcast_tick_pull(), no?
We can't check the clockevent state, because when exiting broadcast mode the
state is switched to oneshot, but the clockevent is still shutdown, due to
some device (e.g. arm arch timers) do not implement set_state_oneshot handler,
the switch operation only change the state value.
Yeah, hotplug_cpu__broadcast_tick_pull() is the proper place to do the check.
Thank you for your advice, I have modified it and sent you the v2 patch.
Best regards,
Yu