Re: [PATCH v1] sched: idle: Consolidate the handling of two special cases

From: Qais Yousef

Date: Fri Mar 13 2026 - 11:39:18 EST


On 03/13/26 13:25, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> There are two special cases in the idle loop that are handled
> inconsistently even though they are analogous.
>
> The first one is when a cpuidle driver is absent and the default CPU
> idle time power management implemented by the architecture code is used.
> In that case, the scheduler tick is stopped every time before invoking
> default_idle_call().
>
> The second one is when a cpuidle driver is present, but there is only
> one idle state in its table. In that case, the scheduler tick is never
> stopped.
>
> Since each of these approaches leads to suboptimal choices in some
> cases, reconcile them with the help of one simple heuristic. Namely,
> stop the tick if the CPU has been woken up by it in the previous
> iteration of the idle loop, or let it tick otherwise.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---

Thanks for the comment!

Reviewed-by: Qais Yousef <qyousef@xxxxxxxxxxx>