aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/tick.h5
-rw-r--r--kernel/time/tick-sched.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/tick.h b/include/linux/tick.h
index d3c02695dc5..8cf8cfe2cc9 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -74,10 +74,13 @@ extern struct tick_device *tick_get_device(int cpu);
74extern int tick_init_highres(void); 74extern int tick_init_highres(void);
75extern int tick_program_event(ktime_t expires, int force); 75extern int tick_program_event(ktime_t expires, int force);
76extern void tick_setup_sched_timer(void); 76extern void tick_setup_sched_timer(void);
77# endif
78
79# if defined CONFIG_NO_HZ || defined CONFIG_HIGH_RES_TIMERS
77extern void tick_cancel_sched_timer(int cpu); 80extern void tick_cancel_sched_timer(int cpu);
78# else 81# else
79static inline void tick_cancel_sched_timer(int cpu) { } 82static inline void tick_cancel_sched_timer(int cpu) { }
80# endif /* HIGHRES */ 83# endif
81 84
82# ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST 85# ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
83extern struct tick_device *tick_get_broadcast_device(void); 86extern struct tick_device *tick_get_broadcast_device(void);
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index f5da526424a..7a46bde78c6 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -643,17 +643,21 @@ void tick_setup_sched_timer(void)
643 ts->nohz_mode = NOHZ_MODE_HIGHRES; 643 ts->nohz_mode = NOHZ_MODE_HIGHRES;
644#endif 644#endif
645} 645}
646#endif /* HIGH_RES_TIMERS */
646 647
648#if defined CONFIG_NO_HZ || defined CONFIG_HIGH_RES_TIMERS
647void tick_cancel_sched_timer(int cpu) 649void tick_cancel_sched_timer(int cpu)
648{ 650{
649 struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); 651 struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
650 652
653# ifdef CONFIG_HIGH_RES_TIMERS
651 if (ts->sched_timer.base) 654 if (ts->sched_timer.base)
652 hrtimer_cancel(&ts->sched_timer); 655 hrtimer_cancel(&ts->sched_timer);
656# endif
653 657
654 ts->nohz_mode = NOHZ_MODE_INACTIVE; 658 ts->nohz_mode = NOHZ_MODE_INACTIVE;
655} 659}
656#endif /* HIGH_RES_TIMERS */ 660#endif
657 661
658/** 662/**
659 * Async notification about clocksource changes 663 * Async notification about clocksource changes