aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tick.h
diff options
context:
space:
mode:
authorVenki Pallipadi <venkatesh.pallipadi@intel.com>2008-01-30 07:30:04 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:04 -0500
commit6378ddb592158db4b42197f1bc8666228800e379 (patch)
treef9b1e671dfd12fb221f6140dd231ccb14cd9f27e /include/linux/tick.h
parentbbe4d18ac2e058c56adb0cd71f49d9ed3216a405 (diff)
time: track accurate idle time with tick_sched.idle_sleeptime
Current idle time in kstat is based on jiffies and is coarse grained. tick_sched.idle_sleeptime is making some attempt to keep track of idle time in a fine grained manner. But, it is not handling the time spent in interrupts fully. Make tick_sched.idle_sleeptime accurate with respect to time spent on handling interrupts and also add tick_sched.idle_lastupdate, which keeps track of last time when idle_sleeptime was updated. This statistics will be crucial for cpufreq-ondemand governor, which can shed some conservative gaurd band that is uses today while setting the frequency. The ondemand changes that uses the exact idle time is coming soon. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/tick.h')
-rw-r--r--include/linux/tick.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/tick.h b/include/linux/tick.h
index f4a1395e05ff..0fadf95debe1 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -51,8 +51,10 @@ struct tick_sched {
51 unsigned long idle_jiffies; 51 unsigned long idle_jiffies;
52 unsigned long idle_calls; 52 unsigned long idle_calls;
53 unsigned long idle_sleeps; 53 unsigned long idle_sleeps;
54 int idle_active;
54 ktime_t idle_entrytime; 55 ktime_t idle_entrytime;
55 ktime_t idle_sleeptime; 56 ktime_t idle_sleeptime;
57 ktime_t idle_lastupdate;
56 ktime_t sleep_length; 58 ktime_t sleep_length;
57 unsigned long last_jiffies; 59 unsigned long last_jiffies;
58 unsigned long next_jiffies; 60 unsigned long next_jiffies;
@@ -103,6 +105,8 @@ extern void tick_nohz_stop_sched_tick(void);
103extern void tick_nohz_restart_sched_tick(void); 105extern void tick_nohz_restart_sched_tick(void);
104extern void tick_nohz_update_jiffies(void); 106extern void tick_nohz_update_jiffies(void);
105extern ktime_t tick_nohz_get_sleep_length(void); 107extern ktime_t tick_nohz_get_sleep_length(void);
108extern void tick_nohz_stop_idle(int cpu);
109extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time);
106# else 110# else
107static inline void tick_nohz_stop_sched_tick(void) { } 111static inline void tick_nohz_stop_sched_tick(void) { }
108static inline void tick_nohz_restart_sched_tick(void) { } 112static inline void tick_nohz_restart_sched_tick(void) { }
@@ -113,6 +117,8 @@ static inline ktime_t tick_nohz_get_sleep_length(void)
113 117
114 return len; 118 return len;
115} 119}
120static inline void tick_nohz_stop_idle(int cpu) { }
121static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return 0; }
116# endif /* !NO_HZ */ 122# endif /* !NO_HZ */
117 123
118#endif 124#endif