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]
Message-ID: <CAG-99FPLOXWnjb_oiDbLmdrYnDnticN9r1drDm_8JHtG=4BSiA@mail.gmail.com>
Date:	Thu, 10 Apr 2014 17:27:28 +0300
From:	Tuukka Tikkanen <tuukka.tikkanen@...aro.org>
To:	Chander Kashyap <chander.kashyap@...aro.org>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	rafael.j.wysocki@...el.com,
	Daniel Lezcano <daniel.lezcano@...aro.org>
Subject: Re: [PATCH] cpuidle: governor: menu: move repeated correction factor
 check to init

On 10 April 2014 16:43, Chander Kashyap <chander.kashyap@...aro.org> wrote:
> In menu_select function we check for correction factor every time.
> If it is zero we are initializing to unity. Hence move it to init function
> and initialise by unity, hence avoid repeated comparisons.
>
> Signed-off-by: Chander Kashyap <chander.kashyap@...aro.org>
> ---
>  drivers/cpuidle/governors/menu.c |   15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> index cf7f2f0..048f6d9 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>         multiplier = performance_multiplier();
>
>         /*
> -        * if the correction factor is 0 (eg first time init or cpu hotplug
> -        * etc), we actually want to start out with a unity factor.
> -        */
> -       if (data->correction_factor[data->bucket] == 0)
> -               data->correction_factor[data->bucket] = RESOLUTION * DECAY;
> -
> -       /*
>          * Force the result of multiplication to be 64 bits even if both
>          * operands are 32 bits.
>          * Make sure to round up for half microseconds.
> @@ -453,9 +446,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
>                                 struct cpuidle_device *dev)
>  {
>         struct menu_device *data = &per_cpu(menu_devices, dev->cpu);
> +       int i;
>
>         memset(data, 0, sizeof(struct menu_device));
>
> +       /*
> +        * if the correction factor is 0 (eg first time init or cpu hotplug
> +        * etc), we actually want to start out with a unity factor.
> +        */
> +       for(i = 0; i < BUCKETS; i++)
> +               data->correction_factor[i] = RESOLUTION * DECAY;
> +
>         return 0;
>  }
>
> --
> 1.7.9.5
>

Reviewed-by: Tuukka Tikkanen <tuukka.tikkanen@...aro.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ