[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jiBrx2xxf2EdvGrqke0ByK5YWXEw0R2rpHZYAJjgwJmg@mail.gmail.com>
Date: Fri, 15 Nov 2019 00:50:59 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Linux PM <linux-pm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Doug Smythies <dsmythies@...us.net>
Subject: Re: [PATCH 2/3] cpuidle: teo: Avoid expecting unrealistic idle times
On Wed, Nov 13, 2019 at 1:11 AM Rafael J. Wysocki <rjw@...ysocki.net> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> If an idle state shallower than the one "matching" the time till the
> next timer event is considered for selection, expect the idle duration
> to fall in the middle of the "bin" corresponding to that state rather
> than at the beginning of it which is unrealistic.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> drivers/cpuidle/governors/teo.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> Index: linux-pm/drivers/cpuidle/governors/teo.c
> ===================================================================
> --- linux-pm.orig/drivers/cpuidle/governors/teo.c
> +++ linux-pm/drivers/cpuidle/governors/teo.c
> @@ -360,7 +360,14 @@ static int teo_select(struct cpuidle_dri
>
> if (max_early_idx >= 0) {
> idx = max_early_idx;
> - duration_ns = drv->states[idx].target_residency_ns;
> + /*
> + * Expect the idle duration to fall in the middle of the
> + * "bin" corresponding to idx (note that the maximum
> + * state index is guaranteed to be greater than idx at
> + * this point).
> + */
> + duration_ns = (drv->states[idx].target_residency_ns +
> + drv->states[idx+1].target_residency_ns) / 2;
> }
> }
This change turns out to cause the governor to choose idle states that
are too deep or too shallow too often, so I'm withdrawing it.
Thanks!
Powered by blists - more mailing lists