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


Groups > linux.kernel > #1424838

[RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length

From Zhaoyang Huang <zhaoyang.huang@linaro.org>
Newsgroups linux.kernel
Subject [RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length
Date 2016-06-17 11:20 +0200
Message-ID <rKY6t-4F5-7@gated-at.bofh.it> (permalink)
References <rKY6t-4F5-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


There should be a gap between tick_nohz_idle_enter and
tick_nohz_get_sleep_length when idle, which will cause the
sleep_length is not very precised. Change it in this patch.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@spreadtrum.com>
---
 kernel/time/tick-sched.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 536ada8..ee3be3d 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -975,6 +975,11 @@ void tick_nohz_irq_exit(void)
 ktime_t tick_nohz_get_sleep_length(void)
 {
 	struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);
+	struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev);
+	ktime_t now;
+
+	now = ktime_get();
+	ts->sleep_length = ktime_sub(dev->next_event, now);
 
 	return ts->sleep_length;
 }
-- 
1.7.9.5

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


Thread

[RESEND PATCH v2 1/2] power/cpuidle: enhance the precision of state select Zhaoyang Huang <zhaoyang.huang@linaro.org> - 2016-06-17 11:20 +0200
  [RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length Zhaoyang Huang <zhaoyang.huang@linaro.org> - 2016-06-17 11:20 +0200
    Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of  sleep_length Thomas Gleixner <tglx@linutronix.de> - 2016-06-17 11:30 +0200
      Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length Zhaoyang Huang <zhaoyang.huang@linaro.org> - 2016-06-17 13:20 +0200
        Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of  sleep_length Thomas Gleixner <tglx@linutronix.de> - 2016-06-17 14:00 +0200
          Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length Zhaoyang Huang <zhaoyang.huang@linaro.org> - 2016-06-20 03:20 +0200
            Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length Zhaoyang Huang <zhaoyang.huang@linaro.org> - 2016-06-22 05:10 +0200
              Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of  sleep_length Thomas Gleixner <tglx@linutronix.de> - 2016-06-23 09:10 +0200
                Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length Zhaoyang Huang <zhaoyang.huang@linaro.org> - 2016-06-23 09:30 +0200
                Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of  sleep_length Thomas Gleixner <tglx@linutronix.de> - 2016-06-23 10:30 +0200
                Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of  sleep_length Thomas Gleixner <tglx@linutronix.de> - 2016-06-23 10:40 +0200
                Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length Zhaoyang Huang <zhaoyang.huang@linaro.org> - 2016-06-23 10:50 +0200
                Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of  sleep_length Thomas Gleixner <tglx@linutronix.de> - 2016-06-23 12:20 +0200
                Re: [RESEND PATCH v2 2/2] power/idle: enhance the precision of sleep_length Zhaoyang Huang <zhaoyang.huang@linaro.org> - 2016-06-23 10:40 +0200

csiph-web