lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 13 Nov 2019 23:19:48 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH RFC 3/3] cpuidle: Use the latency to call find_deepest_idle_state

On Wed, Nov 13, 2019 at 7:54 PM Daniel Lezcano
<daniel.lezcano@...aro.org> wrote:
>
> As the dev->use_latency is filled with the latency value when this
> function is called, use it as a parameter to the
> find_deepest_idle_state() function.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>
> ---
>  drivers/cpuidle/cpuidle.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index f68a6c9e8482..659d8b1ece6d 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -124,7 +124,7 @@ void cpuidle_use_latency(unsigned int latency)
>  int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
>                                struct cpuidle_device *dev)
>  {
> -       return find_deepest_state(drv, dev, UINT_MAX, 0, false);
> +       return find_deepest_state(drv, dev, dev->use_latency, 0, false);

This breaks the suspend-to-idle case when ->enter_s2idle is NULL for
all of the enabled states, because the latency limit for forced idle
should not be applied then.

Maybe pass the latency limit to cpuidle_find_deepest_state() and
rearrange the code in cpuidle_idle_call() to use U64_MAX in the s2idle
case.

BTW, note that find_deepest_state() will take a u64 latency limit in
ns now (and going forward).

>  }
>
>  #ifdef CONFIG_SUSPEND
> --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ