[<prev] [next>] [day] [month] [year] [list]
Message-ID: <57591c5e.582b620a.f8dc2.19dd@mx.google.com>
Date: Thu, 9 Jun 2016 15:34:44 +0800
From: zhaoyang.huang@...aro.org
To: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
mingo@...hat.com, peterz@...radead.org,
zhaoyang.huang@...eadtrum.com, tglx@...utronix.de
Subject: [RFC PATCH v2 2/2] power/idle: enhance the precision of sleep_length
From: Zhaoyang Huang <zhaoyang.huang@...eadtrum.com>
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@...eadtrum.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
Powered by blists - more mailing lists