diff options
-rw-r--r-- | include/linux/tick.h | 17 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/include/linux/tick.h b/include/linux/tick.h index f37fceb69b73..2307dd31b966 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -8,6 +8,8 @@ | |||
8 | 8 | ||
9 | #include <linux/clockchips.h> | 9 | #include <linux/clockchips.h> |
10 | #include <linux/irqflags.h> | 10 | #include <linux/irqflags.h> |
11 | #include <linux/percpu.h> | ||
12 | #include <linux/hrtimer.h> | ||
11 | 13 | ||
12 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 14 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
13 | 15 | ||
@@ -122,13 +124,26 @@ static inline int tick_oneshot_mode_active(void) { return 0; } | |||
122 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | 124 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ |
123 | 125 | ||
124 | # ifdef CONFIG_NO_HZ | 126 | # ifdef CONFIG_NO_HZ |
127 | DECLARE_PER_CPU(struct tick_sched, tick_cpu_sched); | ||
128 | |||
129 | static inline int tick_nohz_tick_stopped(void) | ||
130 | { | ||
131 | return __this_cpu_read(tick_cpu_sched.tick_stopped); | ||
132 | } | ||
133 | |||
125 | extern void tick_nohz_idle_enter(void); | 134 | extern void tick_nohz_idle_enter(void); |
126 | extern void tick_nohz_idle_exit(void); | 135 | extern void tick_nohz_idle_exit(void); |
127 | extern void tick_nohz_irq_exit(void); | 136 | extern void tick_nohz_irq_exit(void); |
128 | extern ktime_t tick_nohz_get_sleep_length(void); | 137 | extern ktime_t tick_nohz_get_sleep_length(void); |
129 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); | 138 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); |
130 | extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); | 139 | extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); |
131 | # else | 140 | |
141 | # else /* !CONFIG_NO_HZ */ | ||
142 | static inline int tick_nohz_tick_stopped(void) | ||
143 | { | ||
144 | return 0; | ||
145 | } | ||
146 | |||
132 | static inline void tick_nohz_idle_enter(void) { } | 147 | static inline void tick_nohz_idle_enter(void) { } |
133 | static inline void tick_nohz_idle_exit(void) { } | 148 | static inline void tick_nohz_idle_exit(void) { } |
134 | 149 | ||
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index a40260885265..9e945aa090ac 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -28,7 +28,7 @@ | |||
28 | /* | 28 | /* |
29 | * Per cpu nohz control structure | 29 | * Per cpu nohz control structure |
30 | */ | 30 | */ |
31 | static DEFINE_PER_CPU(struct tick_sched, tick_cpu_sched); | 31 | DEFINE_PER_CPU(struct tick_sched, tick_cpu_sched); |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * The time, when the last jiffy update happened. Protected by xtime_lock. | 34 | * The time, when the last jiffy update happened. Protected by xtime_lock. |