Re: [PATCH v6 2/2] cpuidle: teo: Introduce util-awareness

From: Vincent Guittot
Date: Tue May 28 2024 - 10:08:41 EST


On Tue, 28 May 2024 at 11:59, Lukasz Luba <lukasz.luba@xxxxxxx> wrote:
>
> Hi Vincent,
>
> On 5/28/24 10:29, Vincent Guittot wrote:
> > Hi All,
> >
> > I'm quite late on this thread but this patchset creates a major
> > regression for psci cpuidle driver when using the OSI mode (OS
> > initiated mode). In such a case, cpuidle driver takes care only of
> > CPUs power state and the deeper C-states ,which includes cluster and
> > other power domains, are handled with power domain framework. In such
> > configuration ,cpuidle has only 2 c-states : WFI and cpu off states
> > and others states that include the clusters, are managed by genpd and
> > its governor.
> >
> > This patch selects cpuidle c-state N-1 as soon as the utilization is
> > above CPU capacity / 64 which means at most a level of 16 on the big
> > core but can be as low as 4 on little cores. These levels are very low
> > and the main result is that as soon as there is very little activity
> > on a CPU, cpuidle always selects WFI states whatever the estimated
> > sleep duration and which prevents any deeper states. Another effect is
> > that it also keeps the tick firing every 1ms in my case.
>
> Thanks for reporting this.
> Could you add what regression it's causing, please?
> Performance or higher power?

It's not a perf but rather a power regression. I don't have a power
counter so it's difficult to give figures but I found it while running
a unitary test below on my rb5:
run 500us every 19457ms on medium core (uclamp_min: 600).

With this use case, the idle time is more than 18ms (the 500us becomes
1ms as we don't run at max capacity) but the tick fires every 1ms
while the system is fully idle (all 8 cpus are idle) and as cpuidle
selects WFI, it prevents the full cluster power down. So even if WFI
is efficient, the power impact should be significant.

For a 5 sec test duration, the system doesn't spend any time in
cluster power down state with this patch but spent 3.9 sec in cluster
power down state without


> Do you have some handy numbers, so we can see the problem size?
>
> >
> > IMO, we should at least increase the utilization level
>
> Something worth to discuss, or make it configurable even.
>
> Regards,
> Lukasz
>
> >
> > Regards,
> > Vincent