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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 24 Mar 2016 14:01:02 +0100
From:	"Rafael J. Wysocki" <rafael@...nel.org>
To:	Jisheng Zhang <jszhang@...vell.com>
Cc:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] cpuidle: arm: make enter idle operation a bit more efficient

On Thu, Mar 24, 2016 at 6:07 AM, Jisheng Zhang <jszhang@...vell.com> wrote:
> Currently, entering idle need to check the idx every time to choose the
> real entering idle routine. But this check could be avoided by pointing
> the idle enter function pointer of each idle states to the routines
> suitable for each states directly.
>
> Signed-off-by: Jisheng Zhang <jszhang@...vell.com>

This looks reasonable to me, but I need an ACK from the maintainer of this code.

> ---
>  drivers/cpuidle/cpuidle-arm.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
> index 545069d..48a620f 100644
> --- a/drivers/cpuidle/cpuidle-arm.c
> +++ b/drivers/cpuidle/cpuidle-arm.c
> @@ -23,6 +23,13 @@
>
>  #include "dt_idle_states.h"
>
> +static int arm_enter_wfi_state(struct cpuidle_device *dev,
> +                              struct cpuidle_driver *drv, int idx)
> +{
> +       cpu_do_idle();
> +       return 0;
> +}
> +
>  /*
>   * arm_enter_idle_state - Programs CPU to enter the specified state
>   *
> @@ -38,11 +45,6 @@ static int arm_enter_idle_state(struct cpuidle_device *dev,
>  {
>         int ret;
>
> -       if (!idx) {
> -               cpu_do_idle();
> -               return idx;
> -       }
> -
>         ret = cpu_pm_enter();
>         if (!ret) {
>                 /*
> @@ -69,7 +71,7 @@ static struct cpuidle_driver arm_idle_driver = {
>          * handler for idle state index 0.
>          */
>         .states[0] = {
> -               .enter                  = arm_enter_idle_state,
> +               .enter                  = arm_enter_wfi_state,
>                 .exit_latency           = 1,
>                 .target_residency       = 1,
>                 .power_usage            = UINT_MAX,
> --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ