aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tick.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tick.h')
-rw-r--r--include/linux/tick.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 9a7252e089b9..f4a1395e05ff 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -40,6 +40,7 @@ enum tick_nohz_mode {
40 * @idle_sleeps: Number of idle calls, where the sched tick was stopped 40 * @idle_sleeps: Number of idle calls, where the sched tick was stopped
41 * @idle_entrytime: Time when the idle call was entered 41 * @idle_entrytime: Time when the idle call was entered
42 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped 42 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped
43 * @sleep_length: Duration of the current idle sleep
43 */ 44 */
44struct tick_sched { 45struct tick_sched {
45 struct hrtimer sched_timer; 46 struct hrtimer sched_timer;
@@ -52,6 +53,7 @@ struct tick_sched {
52 unsigned long idle_sleeps; 53 unsigned long idle_sleeps;
53 ktime_t idle_entrytime; 54 ktime_t idle_entrytime;
54 ktime_t idle_sleeptime; 55 ktime_t idle_sleeptime;
56 ktime_t sleep_length;
55 unsigned long last_jiffies; 57 unsigned long last_jiffies;
56 unsigned long next_jiffies; 58 unsigned long next_jiffies;
57 ktime_t idle_expires; 59 ktime_t idle_expires;
@@ -100,10 +102,17 @@ static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
100extern void tick_nohz_stop_sched_tick(void); 102extern void tick_nohz_stop_sched_tick(void);
101extern void tick_nohz_restart_sched_tick(void); 103extern void tick_nohz_restart_sched_tick(void);
102extern void tick_nohz_update_jiffies(void); 104extern void tick_nohz_update_jiffies(void);
105extern ktime_t tick_nohz_get_sleep_length(void);
103# else 106# else
104static inline void tick_nohz_stop_sched_tick(void) { } 107static inline void tick_nohz_stop_sched_tick(void) { }
105static inline void tick_nohz_restart_sched_tick(void) { } 108static inline void tick_nohz_restart_sched_tick(void) { }
106static inline void tick_nohz_update_jiffies(void) { } 109static inline void tick_nohz_update_jiffies(void) { }
110static inline ktime_t tick_nohz_get_sleep_length(void)
111{
112 ktime_t len = { .tv64 = NSEC_PER_SEC/HZ };
113
114 return len;
115}
107# endif /* !NO_HZ */ 116# endif /* !NO_HZ */
108 117
109#endif 118#endif