diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-03-10 06:54:21 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-05-06 08:58:26 -0400 |
commit | e5ef27d0f5acf9f1db2882d7546a41c021f66820 (patch) | |
tree | d8e2feb1189afb5421d283fee162c8a05c2affac /kernel/sched | |
parent | 20a5c8cc74ade5027c2b0e2bc724278afd6054f3 (diff) |
sched: Make hrtick_notifier an explicit call
No need for an extra notifier. We don't need to handle all these states. It's
sufficient to kill the timer when the cpu dies.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160310120025.770528462@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 28ffd6882ea6..9c710ad0ac22 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -249,29 +249,6 @@ void hrtick_start(struct rq *rq, u64 delay) | |||
249 | } | 249 | } |
250 | } | 250 | } |
251 | 251 | ||
252 | static int | ||
253 | hotplug_hrtick(struct notifier_block *nfb, unsigned long action, void *hcpu) | ||
254 | { | ||
255 | int cpu = (int)(long)hcpu; | ||
256 | |||
257 | switch (action) { | ||
258 | case CPU_UP_CANCELED: | ||
259 | case CPU_UP_CANCELED_FROZEN: | ||
260 | case CPU_DOWN_PREPARE: | ||
261 | case CPU_DOWN_PREPARE_FROZEN: | ||
262 | case CPU_DEAD: | ||
263 | case CPU_DEAD_FROZEN: | ||
264 | hrtick_clear(cpu_rq(cpu)); | ||
265 | return NOTIFY_OK; | ||
266 | } | ||
267 | |||
268 | return NOTIFY_DONE; | ||
269 | } | ||
270 | |||
271 | static __init void init_hrtick(void) | ||
272 | { | ||
273 | hotcpu_notifier(hotplug_hrtick, 0); | ||
274 | } | ||
275 | #else | 252 | #else |
276 | /* | 253 | /* |
277 | * Called to set the hrtick timer state. | 254 | * Called to set the hrtick timer state. |
@@ -288,10 +265,6 @@ void hrtick_start(struct rq *rq, u64 delay) | |||
288 | hrtimer_start(&rq->hrtick_timer, ns_to_ktime(delay), | 265 | hrtimer_start(&rq->hrtick_timer, ns_to_ktime(delay), |
289 | HRTIMER_MODE_REL_PINNED); | 266 | HRTIMER_MODE_REL_PINNED); |
290 | } | 267 | } |
291 | |||
292 | static inline void init_hrtick(void) | ||
293 | { | ||
294 | } | ||
295 | #endif /* CONFIG_SMP */ | 268 | #endif /* CONFIG_SMP */ |
296 | 269 | ||
297 | static void init_rq_hrtick(struct rq *rq) | 270 | static void init_rq_hrtick(struct rq *rq) |
@@ -315,10 +288,6 @@ static inline void hrtick_clear(struct rq *rq) | |||
315 | static inline void init_rq_hrtick(struct rq *rq) | 288 | static inline void init_rq_hrtick(struct rq *rq) |
316 | { | 289 | { |
317 | } | 290 | } |
318 | |||
319 | static inline void init_hrtick(void) | ||
320 | { | ||
321 | } | ||
322 | #endif /* CONFIG_SCHED_HRTICK */ | 291 | #endif /* CONFIG_SCHED_HRTICK */ |
323 | 292 | ||
324 | /* | 293 | /* |
@@ -7132,6 +7101,7 @@ int sched_cpu_dying(unsigned int cpu) | |||
7132 | calc_load_migrate(rq); | 7101 | calc_load_migrate(rq); |
7133 | update_max_interval(); | 7102 | update_max_interval(); |
7134 | nohz_balance_exit_idle(cpu); | 7103 | nohz_balance_exit_idle(cpu); |
7104 | hrtick_clear(rq); | ||
7135 | return 0; | 7105 | return 0; |
7136 | } | 7106 | } |
7137 | #endif | 7107 | #endif |
@@ -7157,8 +7127,6 @@ void __init sched_init_smp(void) | |||
7157 | cpumask_set_cpu(smp_processor_id(), non_isolated_cpus); | 7127 | cpumask_set_cpu(smp_processor_id(), non_isolated_cpus); |
7158 | mutex_unlock(&sched_domains_mutex); | 7128 | mutex_unlock(&sched_domains_mutex); |
7159 | 7129 | ||
7160 | init_hrtick(); | ||
7161 | |||
7162 | /* Move init over to a non-isolated CPU */ | 7130 | /* Move init over to a non-isolated CPU */ |
7163 | if (set_cpus_allowed_ptr(current, non_isolated_cpus) < 0) | 7131 | if (set_cpus_allowed_ptr(current, non_isolated_cpus) < 0) |
7164 | BUG(); | 7132 | BUG(); |