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:	Wed, 06 Aug 2014 16:17:36 +0200
From:	Daniel Lezcano <daniel.lezcano@...aro.org>
To:	Mel Gorman <mgorman@...e.de>,
	Rafael J Wysocki <rafael.j.wysocki@...el.com>,
	Nicolas Pitre <nico@...aro.org>
CC:	Mike Galbraith <mgalbraith@...e.de>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] cpuidle: menu: Use ktime_to_us instead of reinventing
 the wheel

On 08/06/2014 03:19 PM, Mel Gorman wrote:
> The ktime_to_us implementation is slightly better than the one implemented
> in menu.c. Use it
>
> Signed-off-by: Mel Gorman <mgorman@...e.de>

Acked-by: Daniel Lezcano <daniel.lezcano@...aro.org>

> ---
>   drivers/cpuidle/governors/menu.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> index 801b2ee..373278a 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -297,7 +297,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>   	int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
>   	int i;
>   	unsigned int interactivity_req;
> -	struct timespec t;
>
>   	if (data->needs_update) {
>   		menu_update(drv, dev);
> @@ -311,9 +310,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>   		return 0;
>
>   	/* determine the expected residency time, round up */
> -	t = ktime_to_timespec(tick_nohz_get_sleep_length());
> -	data->next_timer_us =
> -		t.tv_sec * USEC_PER_SEC + t.tv_nsec / NSEC_PER_USEC;
> +	data->next_timer_us = ktime_to_us(tick_nohz_get_sleep_length());
>
>
>   	data->bucket = which_bucket(data->next_timer_us);
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
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