Re: [PATCH v1] sched: idle: Consolidate the handling of two special cases
From: Frederic Weisbecker
Date: Fri Mar 13 2026 - 10:37:39 EST
Le Fri, Mar 13, 2026 at 01:25:41PM +0100, Rafael J. Wysocki a écrit :
> 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>
Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>
--
Frederic Weisbecker
SUSE Labs