diff options
-rw-r--r-- | include/linux/clockchips.h | 15 | ||||
-rw-r--r-- | include/linux/tick.h | 134 | ||||
-rw-r--r-- | kernel/time/clocksource.c | 2 | ||||
-rw-r--r-- | kernel/time/hrtimer.c | 2 | ||||
-rw-r--r-- | kernel/time/tick-internal.h | 15 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 7 | ||||
-rw-r--r-- | kernel/time/tick-sched.h | 64 | ||||
-rw-r--r-- | kernel/time/timer_list.c | 2 |
8 files changed, 112 insertions, 129 deletions
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 57975131dac1..bc3af821350b 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -193,15 +193,6 @@ extern void clockevents_config_and_register(struct clock_event_device *dev, | |||
193 | 193 | ||
194 | extern int clockevents_update_freq(struct clock_event_device *ce, u32 freq); | 194 | extern int clockevents_update_freq(struct clock_event_device *ce, u32 freq); |
195 | 195 | ||
196 | extern void clockevents_exchange_device(struct clock_event_device *old, | ||
197 | struct clock_event_device *new); | ||
198 | extern void clockevents_set_state(struct clock_event_device *dev, | ||
199 | enum clock_event_state state); | ||
200 | extern int clockevents_program_event(struct clock_event_device *dev, | ||
201 | ktime_t expires, bool force); | ||
202 | |||
203 | extern void clockevents_handle_noop(struct clock_event_device *dev); | ||
204 | |||
205 | static inline void | 196 | static inline void |
206 | clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec) | 197 | clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec) |
207 | { | 198 | { |
@@ -209,6 +200,12 @@ clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec) | |||
209 | freq, minsec); | 200 | freq, minsec); |
210 | } | 201 | } |
211 | 202 | ||
203 | /* Should be core only, but is abused by arm bl_switcher */ | ||
204 | extern void clockevents_set_state(struct clock_event_device *dev, | ||
205 | enum clock_event_state state); | ||
206 | extern int clockevents_program_event(struct clock_event_device *dev, | ||
207 | ktime_t expires, bool force); | ||
208 | |||
212 | extern void clockevents_suspend(void); | 209 | extern void clockevents_suspend(void); |
213 | extern void clockevents_resume(void); | 210 | extern void clockevents_resume(void); |
214 | 211 | ||
diff --git a/include/linux/tick.h b/include/linux/tick.h index 9c085dc12ae9..f9a2d2687a46 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -1,7 +1,5 @@ | |||
1 | /* linux/include/linux/tick.h | 1 | /* |
2 | * | 2 | * Tick related global functions |
3 | * This file contains the structure definitions for tick related functions | ||
4 | * | ||
5 | */ | 3 | */ |
6 | #ifndef _LINUX_TICK_H | 4 | #ifndef _LINUX_TICK_H |
7 | #define _LINUX_TICK_H | 5 | #define _LINUX_TICK_H |
@@ -9,13 +7,12 @@ | |||
9 | #include <linux/clockchips.h> | 7 | #include <linux/clockchips.h> |
10 | #include <linux/irqflags.h> | 8 | #include <linux/irqflags.h> |
11 | #include <linux/percpu.h> | 9 | #include <linux/percpu.h> |
12 | #include <linux/hrtimer.h> | ||
13 | #include <linux/context_tracking_state.h> | 10 | #include <linux/context_tracking_state.h> |
14 | #include <linux/cpumask.h> | 11 | #include <linux/cpumask.h> |
15 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
16 | 13 | ||
14 | /* ARM BL switcher abuse support */ | ||
17 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 15 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
18 | |||
19 | enum tick_device_mode { | 16 | enum tick_device_mode { |
20 | TICKDEV_MODE_PERIODIC, | 17 | TICKDEV_MODE_PERIODIC, |
21 | TICKDEV_MODE_ONESHOT, | 18 | TICKDEV_MODE_ONESHOT, |
@@ -25,133 +22,38 @@ struct tick_device { | |||
25 | struct clock_event_device *evtdev; | 22 | struct clock_event_device *evtdev; |
26 | enum tick_device_mode mode; | 23 | enum tick_device_mode mode; |
27 | }; | 24 | }; |
28 | |||
29 | enum tick_nohz_mode { | ||
30 | NOHZ_MODE_INACTIVE, | ||
31 | NOHZ_MODE_LOWRES, | ||
32 | NOHZ_MODE_HIGHRES, | ||
33 | }; | ||
34 | |||
35 | /** | ||
36 | * struct tick_sched - sched tick emulation and no idle tick control/stats | ||
37 | * @sched_timer: hrtimer to schedule the periodic tick in high | ||
38 | * resolution mode | ||
39 | * @last_tick: Store the last tick expiry time when the tick | ||
40 | * timer is modified for nohz sleeps. This is necessary | ||
41 | * to resume the tick timer operation in the timeline | ||
42 | * when the CPU returns from nohz sleep. | ||
43 | * @tick_stopped: Indicator that the idle tick has been stopped | ||
44 | * @idle_jiffies: jiffies at the entry to idle for idle time accounting | ||
45 | * @idle_calls: Total number of idle calls | ||
46 | * @idle_sleeps: Number of idle calls, where the sched tick was stopped | ||
47 | * @idle_entrytime: Time when the idle call was entered | ||
48 | * @idle_waketime: Time when the idle was interrupted | ||
49 | * @idle_exittime: Time when the idle state was left | ||
50 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped | ||
51 | * @iowait_sleeptime: Sum of the time slept in idle with sched tick stopped, with IO outstanding | ||
52 | * @sleep_length: Duration of the current idle sleep | ||
53 | * @do_timer_lst: CPU was the last one doing do_timer before going idle | ||
54 | */ | ||
55 | struct tick_sched { | ||
56 | struct hrtimer sched_timer; | ||
57 | unsigned long check_clocks; | ||
58 | enum tick_nohz_mode nohz_mode; | ||
59 | ktime_t last_tick; | ||
60 | int inidle; | ||
61 | int tick_stopped; | ||
62 | unsigned long idle_jiffies; | ||
63 | unsigned long idle_calls; | ||
64 | unsigned long idle_sleeps; | ||
65 | int idle_active; | ||
66 | ktime_t idle_entrytime; | ||
67 | ktime_t idle_waketime; | ||
68 | ktime_t idle_exittime; | ||
69 | ktime_t idle_sleeptime; | ||
70 | ktime_t iowait_sleeptime; | ||
71 | ktime_t sleep_length; | ||
72 | unsigned long last_jiffies; | ||
73 | unsigned long next_jiffies; | ||
74 | ktime_t idle_expires; | ||
75 | int do_timer_last; | ||
76 | }; | ||
77 | |||
78 | extern void __init tick_init(void); | ||
79 | extern int tick_is_oneshot_available(void); | ||
80 | extern struct tick_device *tick_get_device(int cpu); | 25 | extern struct tick_device *tick_get_device(int cpu); |
26 | #endif | ||
81 | 27 | ||
28 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
29 | extern void __init tick_init(void); | ||
82 | extern void tick_freeze(void); | 30 | extern void tick_freeze(void); |
83 | extern void tick_unfreeze(void); | 31 | extern void tick_unfreeze(void); |
32 | #else /* CONFIG_GENERIC_CLOCKEVENTS */ | ||
33 | static inline void tick_init(void) { } | ||
34 | static inline void tick_freeze(void) { } | ||
35 | static inline void tick_unfreeze(void) { } | ||
36 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | ||
84 | 37 | ||
85 | # ifdef CONFIG_HIGH_RES_TIMERS | 38 | #ifdef CONFIG_TICK_ONESHOT |
86 | extern int tick_init_highres(void); | ||
87 | extern int tick_program_event(ktime_t expires, int force); | ||
88 | extern void tick_setup_sched_timer(void); | ||
89 | # endif | ||
90 | |||
91 | # if defined CONFIG_NO_HZ_COMMON || defined CONFIG_HIGH_RES_TIMERS | ||
92 | extern void tick_cancel_sched_timer(int cpu); | ||
93 | # else | ||
94 | static inline void tick_cancel_sched_timer(int cpu) { } | ||
95 | # endif | ||
96 | |||
97 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | ||
98 | extern struct tick_device *tick_get_broadcast_device(void); | ||
99 | extern struct cpumask *tick_get_broadcast_mask(void); | ||
100 | |||
101 | # ifdef CONFIG_TICK_ONESHOT | ||
102 | extern struct cpumask *tick_get_broadcast_oneshot_mask(void); | ||
103 | # endif | ||
104 | |||
105 | # endif /* BROADCAST */ | ||
106 | |||
107 | # ifdef CONFIG_TICK_ONESHOT | ||
108 | extern void tick_clock_notify(void); | ||
109 | extern int tick_check_oneshot_change(int allow_nohz); | ||
110 | extern struct tick_sched *tick_get_tick_sched(int cpu); | ||
111 | extern void tick_irq_enter(void); | 39 | extern void tick_irq_enter(void); |
112 | extern int tick_oneshot_mode_active(void); | ||
113 | # ifndef arch_needs_cpu | 40 | # ifndef arch_needs_cpu |
114 | # define arch_needs_cpu() (0) | 41 | # define arch_needs_cpu() (0) |
115 | # endif | 42 | # endif |
116 | # else | 43 | # else |
117 | static inline void tick_clock_notify(void) { } | ||
118 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | ||
119 | static inline void tick_irq_enter(void) { } | ||
120 | static inline int tick_oneshot_mode_active(void) { return 0; } | ||
121 | # endif | ||
122 | |||
123 | #else /* CONFIG_GENERIC_CLOCKEVENTS */ | ||
124 | static inline void tick_init(void) { } | ||
125 | static inline void tick_freeze(void) { } | ||
126 | static inline void tick_unfreeze(void) { } | ||
127 | static inline void tick_cancel_sched_timer(int cpu) { } | ||
128 | static inline void tick_clock_notify(void) { } | ||
129 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | ||
130 | static inline void tick_irq_enter(void) { } | 44 | static inline void tick_irq_enter(void) { } |
131 | static inline int tick_oneshot_mode_active(void) { return 0; } | 45 | #endif |
132 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | ||
133 | |||
134 | # ifdef CONFIG_NO_HZ_COMMON | ||
135 | DECLARE_PER_CPU(struct tick_sched, tick_cpu_sched); | ||
136 | |||
137 | static inline int tick_nohz_tick_stopped(void) | ||
138 | { | ||
139 | return __this_cpu_read(tick_cpu_sched.tick_stopped); | ||
140 | } | ||
141 | 46 | ||
47 | #ifdef CONFIG_NO_HZ_COMMON | ||
48 | extern int tick_nohz_tick_stopped(void); | ||
142 | extern void tick_nohz_idle_enter(void); | 49 | extern void tick_nohz_idle_enter(void); |
143 | extern void tick_nohz_idle_exit(void); | 50 | extern void tick_nohz_idle_exit(void); |
144 | extern void tick_nohz_irq_exit(void); | 51 | extern void tick_nohz_irq_exit(void); |
145 | extern ktime_t tick_nohz_get_sleep_length(void); | 52 | extern ktime_t tick_nohz_get_sleep_length(void); |
146 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); | 53 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); |
147 | extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); | 54 | extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); |
148 | 55 | #else /* !CONFIG_NO_HZ_COMMON */ | |
149 | # else /* !CONFIG_NO_HZ_COMMON */ | 56 | static inline int tick_nohz_tick_stopped(void) { return 0; } |
150 | static inline int tick_nohz_tick_stopped(void) | ||
151 | { | ||
152 | return 0; | ||
153 | } | ||
154 | |||
155 | static inline void tick_nohz_idle_enter(void) { } | 57 | static inline void tick_nohz_idle_enter(void) { } |
156 | static inline void tick_nohz_idle_exit(void) { } | 58 | static inline void tick_nohz_idle_exit(void) { } |
157 | 59 | ||
@@ -163,7 +65,7 @@ static inline ktime_t tick_nohz_get_sleep_length(void) | |||
163 | } | 65 | } |
164 | static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } | 66 | static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } |
165 | static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } | 67 | static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } |
166 | # endif /* !CONFIG_NO_HZ_COMMON */ | 68 | #endif /* !CONFIG_NO_HZ_COMMON */ |
167 | 69 | ||
168 | #ifdef CONFIG_NO_HZ_FULL | 70 | #ifdef CONFIG_NO_HZ_FULL |
169 | extern bool tick_nohz_full_running; | 71 | extern bool tick_nohz_full_running; |
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 8b4010f0b1b4..c3be3c71bbad 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <linux/tick.h> | 31 | #include <linux/tick.h> |
32 | #include <linux/kthread.h> | 32 | #include <linux/kthread.h> |
33 | 33 | ||
34 | #include "timekeeping.h" | 34 | #include "tick-internal.h" |
35 | #include "timekeeping_internal.h" | 35 | #include "timekeeping_internal.h" |
36 | 36 | ||
37 | /** | 37 | /** |
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index bee0c1f78091..721d29b99d10 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c | |||
@@ -54,7 +54,7 @@ | |||
54 | 54 | ||
55 | #include <trace/events/timer.h> | 55 | #include <trace/events/timer.h> |
56 | 56 | ||
57 | #include "timekeeping.h" | 57 | #include "tick-internal.h" |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * The timer bases: | 60 | * The timer bases: |
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index d86eb8d485e9..dd2c45d057b9 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/tick.h> | 5 | #include <linux/tick.h> |
6 | 6 | ||
7 | #include "timekeeping.h" | 7 | #include "timekeeping.h" |
8 | #include "tick-sched.h" | ||
8 | 9 | ||
9 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 10 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
10 | 11 | ||
@@ -26,6 +27,7 @@ extern void tick_resume(void); | |||
26 | extern bool tick_check_replacement(struct clock_event_device *curdev, | 27 | extern bool tick_check_replacement(struct clock_event_device *curdev, |
27 | struct clock_event_device *newdev); | 28 | struct clock_event_device *newdev); |
28 | extern void tick_install_replacement(struct clock_event_device *dev); | 29 | extern void tick_install_replacement(struct clock_event_device *dev); |
30 | extern int tick_is_oneshot_available(void); | ||
29 | 31 | ||
30 | extern int clockevents_tick_resume(struct clock_event_device *dev); | 32 | extern int clockevents_tick_resume(struct clock_event_device *dev); |
31 | /* Check, if the device is functional or a dummy for broadcast */ | 33 | /* Check, if the device is functional or a dummy for broadcast */ |
@@ -35,6 +37,9 @@ static inline int tick_device_is_functional(struct clock_event_device *dev) | |||
35 | } | 37 | } |
36 | 38 | ||
37 | extern void clockevents_shutdown(struct clock_event_device *dev); | 39 | extern void clockevents_shutdown(struct clock_event_device *dev); |
40 | extern void clockevents_exchange_device(struct clock_event_device *old, | ||
41 | struct clock_event_device *new); | ||
42 | extern void clockevents_handle_noop(struct clock_event_device *dev); | ||
38 | extern int __clockevents_update_freq(struct clock_event_device *dev, u32 freq); | 43 | extern int __clockevents_update_freq(struct clock_event_device *dev, u32 freq); |
39 | extern ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt); | 44 | extern ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt); |
40 | #endif /* GENERIC_CLOCKEVENTS */ | 45 | #endif /* GENERIC_CLOCKEVENTS */ |
@@ -49,6 +54,10 @@ extern void tick_oneshot_notify(void); | |||
49 | extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *)); | 54 | extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *)); |
50 | extern void tick_resume_oneshot(void); | 55 | extern void tick_resume_oneshot(void); |
51 | static inline bool tick_oneshot_possible(void) { return true; } | 56 | static inline bool tick_oneshot_possible(void) { return true; } |
57 | extern int tick_oneshot_mode_active(void); | ||
58 | extern void tick_clock_notify(void); | ||
59 | extern int tick_check_oneshot_change(int allow_nohz); | ||
60 | extern int tick_init_highres(void); | ||
52 | #else /* !ONESHOT */ | 61 | #else /* !ONESHOT */ |
53 | static inline | 62 | static inline |
54 | void tick_setup_oneshot(struct clock_event_device *newdev, | 63 | void tick_setup_oneshot(struct clock_event_device *newdev, |
@@ -58,6 +67,9 @@ static inline void tick_resume_oneshot(void) { BUG(); } | |||
58 | static inline int tick_program_event(ktime_t expires, int force) { return 0; } | 67 | static inline int tick_program_event(ktime_t expires, int force) { return 0; } |
59 | static inline void tick_oneshot_notify(void) { } | 68 | static inline void tick_oneshot_notify(void) { } |
60 | static inline bool tick_oneshot_possible(void) { return false; } | 69 | static inline bool tick_oneshot_possible(void) { return false; } |
70 | static inline int tick_oneshot_mode_active(void) { return 0; } | ||
71 | static inline void tick_clock_notify(void) { } | ||
72 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | ||
61 | #endif /* !TICK_ONESHOT */ | 73 | #endif /* !TICK_ONESHOT */ |
62 | 74 | ||
63 | /* Broadcasting support */ | 75 | /* Broadcasting support */ |
@@ -72,6 +84,8 @@ extern int tick_resume_broadcast(void); | |||
72 | extern void tick_broadcast_init(void); | 84 | extern void tick_broadcast_init(void); |
73 | extern void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast); | 85 | extern void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast); |
74 | extern int tick_broadcast_update_freq(struct clock_event_device *dev, u32 freq); | 86 | extern int tick_broadcast_update_freq(struct clock_event_device *dev, u32 freq); |
87 | extern struct tick_device *tick_get_broadcast_device(void); | ||
88 | extern struct cpumask *tick_get_broadcast_mask(void); | ||
75 | #else /* !BROADCAST */ | 89 | #else /* !BROADCAST */ |
76 | static inline void tick_install_broadcast_device(struct clock_event_device *dev) { } | 90 | static inline void tick_install_broadcast_device(struct clock_event_device *dev) { } |
77 | static inline int tick_is_broadcast_device(struct clock_event_device *dev) { return 0; } | 91 | static inline int tick_is_broadcast_device(struct clock_event_device *dev) { return 0; } |
@@ -101,6 +115,7 @@ extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); | |||
101 | extern int tick_broadcast_oneshot_active(void); | 115 | extern int tick_broadcast_oneshot_active(void); |
102 | extern void tick_check_oneshot_broadcast_this_cpu(void); | 116 | extern void tick_check_oneshot_broadcast_this_cpu(void); |
103 | bool tick_broadcast_oneshot_available(void); | 117 | bool tick_broadcast_oneshot_available(void); |
118 | extern struct cpumask *tick_get_broadcast_oneshot_mask(void); | ||
104 | #else /* BROADCAST && ONESHOT */ | 119 | #else /* BROADCAST && ONESHOT */ |
105 | static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { BUG(); } | 120 | static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { BUG(); } |
106 | static inline int tick_broadcast_oneshot_control(unsigned long reason) { return 0; } | 121 | static inline int tick_broadcast_oneshot_control(unsigned long reason) { return 0; } |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index a4c4edac4528..914259128145 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -34,7 +34,7 @@ | |||
34 | /* | 34 | /* |
35 | * Per cpu nohz control structure | 35 | * Per cpu nohz control structure |
36 | */ | 36 | */ |
37 | DEFINE_PER_CPU(struct tick_sched, tick_cpu_sched); | 37 | static DEFINE_PER_CPU(struct tick_sched, tick_cpu_sched); |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * The time, when the last jiffy update happened. Protected by jiffies_lock. | 40 | * The time, when the last jiffy update happened. Protected by jiffies_lock. |
@@ -416,6 +416,11 @@ static int __init setup_tick_nohz(char *str) | |||
416 | 416 | ||
417 | __setup("nohz=", setup_tick_nohz); | 417 | __setup("nohz=", setup_tick_nohz); |
418 | 418 | ||
419 | int tick_nohz_tick_stopped(void) | ||
420 | { | ||
421 | return __this_cpu_read(tick_cpu_sched.tick_stopped); | ||
422 | } | ||
423 | |||
419 | /** | 424 | /** |
420 | * tick_nohz_update_jiffies - update jiffies when idle was interrupted | 425 | * tick_nohz_update_jiffies - update jiffies when idle was interrupted |
421 | * | 426 | * |
diff --git a/kernel/time/tick-sched.h b/kernel/time/tick-sched.h new file mode 100644 index 000000000000..930743249127 --- /dev/null +++ b/kernel/time/tick-sched.h | |||
@@ -0,0 +1,64 @@ | |||
1 | #ifndef _TICK_SCHED_H | ||
2 | #define _TICK_SCHED_H | ||
3 | |||
4 | #include <linux/hrtimer.h> | ||
5 | |||
6 | enum tick_nohz_mode { | ||
7 | NOHZ_MODE_INACTIVE, | ||
8 | NOHZ_MODE_LOWRES, | ||
9 | NOHZ_MODE_HIGHRES, | ||
10 | }; | ||
11 | |||
12 | /** | ||
13 | * struct tick_sched - sched tick emulation and no idle tick control/stats | ||
14 | * @sched_timer: hrtimer to schedule the periodic tick in high | ||
15 | * resolution mode | ||
16 | * @last_tick: Store the last tick expiry time when the tick | ||
17 | * timer is modified for nohz sleeps. This is necessary | ||
18 | * to resume the tick timer operation in the timeline | ||
19 | * when the CPU returns from nohz sleep. | ||
20 | * @tick_stopped: Indicator that the idle tick has been stopped | ||
21 | * @idle_jiffies: jiffies at the entry to idle for idle time accounting | ||
22 | * @idle_calls: Total number of idle calls | ||
23 | * @idle_sleeps: Number of idle calls, where the sched tick was stopped | ||
24 | * @idle_entrytime: Time when the idle call was entered | ||
25 | * @idle_waketime: Time when the idle was interrupted | ||
26 | * @idle_exittime: Time when the idle state was left | ||
27 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped | ||
28 | * @iowait_sleeptime: Sum of the time slept in idle with sched tick stopped, with IO outstanding | ||
29 | * @sleep_length: Duration of the current idle sleep | ||
30 | * @do_timer_lst: CPU was the last one doing do_timer before going idle | ||
31 | */ | ||
32 | struct tick_sched { | ||
33 | struct hrtimer sched_timer; | ||
34 | unsigned long check_clocks; | ||
35 | enum tick_nohz_mode nohz_mode; | ||
36 | ktime_t last_tick; | ||
37 | int inidle; | ||
38 | int tick_stopped; | ||
39 | unsigned long idle_jiffies; | ||
40 | unsigned long idle_calls; | ||
41 | unsigned long idle_sleeps; | ||
42 | int idle_active; | ||
43 | ktime_t idle_entrytime; | ||
44 | ktime_t idle_waketime; | ||
45 | ktime_t idle_exittime; | ||
46 | ktime_t idle_sleeptime; | ||
47 | ktime_t iowait_sleeptime; | ||
48 | ktime_t sleep_length; | ||
49 | unsigned long last_jiffies; | ||
50 | unsigned long next_jiffies; | ||
51 | ktime_t idle_expires; | ||
52 | int do_timer_last; | ||
53 | }; | ||
54 | |||
55 | extern struct tick_sched *tick_get_tick_sched(int cpu); | ||
56 | |||
57 | extern void tick_setup_sched_timer(void); | ||
58 | #if defined CONFIG_NO_HZ_COMMON || defined CONFIG_HIGH_RES_TIMERS | ||
59 | extern void tick_cancel_sched_timer(int cpu); | ||
60 | #else | ||
61 | static inline void tick_cancel_sched_timer(int cpu) { } | ||
62 | #endif | ||
63 | |||
64 | #endif | ||
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index 05aa5590106a..e878c2e0ba45 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c | |||
@@ -16,10 +16,10 @@ | |||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/seq_file.h> | 17 | #include <linux/seq_file.h> |
18 | #include <linux/kallsyms.h> | 18 | #include <linux/kallsyms.h> |
19 | #include <linux/tick.h> | ||
20 | 19 | ||
21 | #include <asm/uaccess.h> | 20 | #include <asm/uaccess.h> |
22 | 21 | ||
22 | #include "tick-internal.h" | ||
23 | 23 | ||
24 | struct timer_list_iter { | 24 | struct timer_list_iter { |
25 | int cpu; | 25 | int cpu; |