Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1383330

Re: [PATCH] cpuidle: Change ktime_get() with local_clock()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] cpuidle: Change ktime_get() with local_clock()
Date 2016-04-20 14:20 +0200
Message-ID <rpZgR-7JT-3@gated-at.bofh.it> (permalink)
References <rnV7I-77H-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 14, 2016 at 09:23:54PM +0200, Daniel Lezcano wrote:
> @@ -217,7 +217,11 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
>  	if (!cpuidle_state_is_coupled(drv, entered_state))
>  		local_irq_enable();
>  
> -	diff = ktime_to_us(ktime_sub(time_end, time_start));
> +	/*
> +	 * local_clock() returns the time in nanosecond, let's shift
> +	 * by 10 (divide by 1024) to have microsecond based time.
> +	 */
> +	diff = (time_end - time_start) >> 10;

Changelog fails to explain the ramifications of this change...

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] cpuidle: Change ktime_get() with local_clock() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 14:20 +0200
  Re: [PATCH] cpuidle: Change ktime_get() with local_clock() Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-04-20 14:40 +0200
    Re: [PATCH] cpuidle: Change ktime_get() with local_clock() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 15:00 +0200
      Re: [PATCH] cpuidle: Change ktime_get() with local_clock() Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-04-20 18:50 +0200

csiph-web