| .. | .. |
|---|
| 68 | 68 | static inline void tick_broadcast_control(enum tick_broadcast_mode mode) { } |
|---|
| 69 | 69 | #endif /* BROADCAST */ |
|---|
| 70 | 70 | |
|---|
| 71 | +#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_HOTPLUG_CPU) |
|---|
| 72 | +extern void tick_offline_cpu(unsigned int cpu); |
|---|
| 73 | +#else |
|---|
| 74 | +static inline void tick_offline_cpu(unsigned int cpu) { } |
|---|
| 75 | +#endif |
|---|
| 76 | + |
|---|
| 71 | 77 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
|---|
| 72 | 78 | extern int tick_broadcast_oneshot_control(enum tick_broadcast_state state); |
|---|
| 73 | 79 | #else |
|---|
| .. | .. |
|---|
| 102 | 108 | TICK_DEP_BIT_POSIX_TIMER = 0, |
|---|
| 103 | 109 | TICK_DEP_BIT_PERF_EVENTS = 1, |
|---|
| 104 | 110 | TICK_DEP_BIT_SCHED = 2, |
|---|
| 105 | | - TICK_DEP_BIT_CLOCK_UNSTABLE = 3 |
|---|
| 111 | + TICK_DEP_BIT_CLOCK_UNSTABLE = 3, |
|---|
| 112 | + TICK_DEP_BIT_RCU = 4, |
|---|
| 113 | + TICK_DEP_BIT_RCU_EXP = 5 |
|---|
| 106 | 114 | }; |
|---|
| 115 | +#define TICK_DEP_BIT_MAX TICK_DEP_BIT_RCU_EXP |
|---|
| 107 | 116 | |
|---|
| 108 | 117 | #define TICK_DEP_MASK_NONE 0 |
|---|
| 109 | 118 | #define TICK_DEP_MASK_POSIX_TIMER (1 << TICK_DEP_BIT_POSIX_TIMER) |
|---|
| 110 | 119 | #define TICK_DEP_MASK_PERF_EVENTS (1 << TICK_DEP_BIT_PERF_EVENTS) |
|---|
| 111 | 120 | #define TICK_DEP_MASK_SCHED (1 << TICK_DEP_BIT_SCHED) |
|---|
| 112 | 121 | #define TICK_DEP_MASK_CLOCK_UNSTABLE (1 << TICK_DEP_BIT_CLOCK_UNSTABLE) |
|---|
| 113 | | - |
|---|
| 114 | | -extern void register_tick_sched_wakeup_callback(void (*cb)(void)); |
|---|
| 122 | +#define TICK_DEP_MASK_RCU (1 << TICK_DEP_BIT_RCU) |
|---|
| 123 | +#define TICK_DEP_MASK_RCU_EXP (1 << TICK_DEP_BIT_RCU_EXP) |
|---|
| 115 | 124 | |
|---|
| 116 | 125 | #ifdef CONFIG_NO_HZ_COMMON |
|---|
| 117 | 126 | extern bool tick_nohz_enabled; |
|---|
| .. | .. |
|---|
| 124 | 133 | extern void tick_nohz_idle_exit(void); |
|---|
| 125 | 134 | extern void tick_nohz_irq_exit(void); |
|---|
| 126 | 135 | extern bool tick_nohz_idle_got_tick(void); |
|---|
| 136 | +extern ktime_t tick_nohz_get_next_hrtimer(void); |
|---|
| 127 | 137 | extern ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next); |
|---|
| 128 | 138 | extern unsigned long tick_nohz_get_idle_calls(void); |
|---|
| 129 | 139 | extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu); |
|---|
| .. | .. |
|---|
| 147 | 157 | static inline void tick_nohz_idle_enter(void) { } |
|---|
| 148 | 158 | static inline void tick_nohz_idle_exit(void) { } |
|---|
| 149 | 159 | static inline bool tick_nohz_idle_got_tick(void) { return false; } |
|---|
| 150 | | - |
|---|
| 160 | +static inline ktime_t tick_nohz_get_next_hrtimer(void) |
|---|
| 161 | +{ |
|---|
| 162 | + /* Next wake up is the tick period, assume it starts now */ |
|---|
| 163 | + return ktime_add(ktime_get(), TICK_NSEC); |
|---|
| 164 | +} |
|---|
| 151 | 165 | static inline ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next) |
|---|
| 152 | 166 | { |
|---|
| 153 | 167 | *delta_next = TICK_NSEC; |
|---|
| .. | .. |
|---|
| 165 | 179 | |
|---|
| 166 | 180 | static inline bool tick_nohz_full_enabled(void) |
|---|
| 167 | 181 | { |
|---|
| 168 | | - if (!context_tracking_is_enabled()) |
|---|
| 182 | + if (!context_tracking_enabled()) |
|---|
| 169 | 183 | return false; |
|---|
| 170 | 184 | |
|---|
| 171 | 185 | return tick_nohz_full_running; |
|---|
| .. | .. |
|---|
| 197 | 211 | enum tick_dep_bits bit); |
|---|
| 198 | 212 | extern void tick_nohz_dep_clear_signal(struct signal_struct *signal, |
|---|
| 199 | 213 | enum tick_dep_bits bit); |
|---|
| 214 | +extern bool tick_nohz_cpu_hotpluggable(unsigned int cpu); |
|---|
| 200 | 215 | |
|---|
| 201 | 216 | /* |
|---|
| 202 | 217 | * The below are tick_nohz_[set,clear]_dep() wrappers that optimize off-cases |
|---|
| .. | .. |
|---|
| 259 | 274 | static inline bool tick_nohz_full_cpu(int cpu) { return false; } |
|---|
| 260 | 275 | static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask) { } |
|---|
| 261 | 276 | |
|---|
| 277 | +static inline void tick_nohz_dep_set_cpu(int cpu, enum tick_dep_bits bit) { } |
|---|
| 278 | +static inline void tick_nohz_dep_clear_cpu(int cpu, enum tick_dep_bits bit) { } |
|---|
| 279 | +static inline bool tick_nohz_cpu_hotpluggable(unsigned int cpu) { return true; } |
|---|
| 280 | + |
|---|
| 262 | 281 | static inline void tick_dep_set(enum tick_dep_bits bit) { } |
|---|
| 263 | 282 | static inline void tick_dep_clear(enum tick_dep_bits bit) { } |
|---|
| 264 | 283 | static inline void tick_dep_set_cpu(int cpu, enum tick_dep_bits bit) { } |
|---|
| .. | .. |
|---|
| 283 | 302 | __tick_nohz_task_switch(); |
|---|
| 284 | 303 | } |
|---|
| 285 | 304 | |
|---|
| 286 | | -ktime_t *get_next_event_cpu(unsigned int cpu); |
|---|
| 287 | 305 | #endif |
|---|