[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1499650721-5928-7-git-send-email-aubrey.li@intel.com>
Date: Mon, 10 Jul 2017 09:38:36 +0800
From: Aubrey Li <aubrey.li@...el.com>
To: tglx@...utronix.de, peterz@...radead.org, len.brown@...el.com,
rjw@...ysocki.net, ak@...ux.intel.com, tim.c.chen@...ux.intel.com,
arjan@...ux.intel.com, paulmck@...ux.vnet.ibm.com,
yang.zhang.wz@...il.com
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Aubrey Li <aubrey.li@...ux.intel.com>
Subject: [RFC PATCH v1 06/11] timers: keep sleep length updated as needed
From: Aubrey Li <aubrey.li@...ux.intel.com>
sleep length indicates how long we'll be idle. Currently, it's updated
only when tick nohz enters. These patch series make a new requirement
with tick, so we should keep sleep length updated as needed
---
kernel/time/tick-sched.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 7fe53be..8bf6e8b 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -988,8 +988,11 @@ void tick_nohz_irq_exit(void)
*/
ktime_t tick_nohz_get_sleep_length(void)
{
+ struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev);
struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);
+ ts->sleep_length = ktime_sub(dev->next_event, ktime_get());
+
return ts->sleep_length;
}
--
2.7.4
Powered by blists - more mailing lists