diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-06-21 19:29:17 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-23 05:23:47 -0400 |
commit | 9e1e01dd79ac4cf936623399abe57dfba4528ae6 (patch) | |
tree | b407bd9cf2801df74b78e40e618bcc3037bba704 /kernel/time/hrtimer.c | |
parent | 49a2a07514a3a2ea4a02482fa60575e106d960f9 (diff) |
hrtimer: Remove hrtimer_enqueue_reprogram()
We call hrtimer_enqueue_reprogram() only when we are in high resolution
mode now so we don't need to check that again in hrtimer_enqueue_reprogram().
Once the check is removed, hrtimer_enqueue_reprogram() turns to be an
useless wrapper over hrtimer_reprogram() and can be dropped.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1403393357-2070-6-git-send-email-fweisbec@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time/hrtimer.c')
-rw-r--r-- | kernel/time/hrtimer.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index f9007478fcce..66a6dc1075ad 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c | |||
@@ -602,6 +602,11 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) | |||
602 | * timers, we have to check, whether it expires earlier than the timer for | 602 | * timers, we have to check, whether it expires earlier than the timer for |
603 | * which the clock event device was armed. | 603 | * which the clock event device was armed. |
604 | * | 604 | * |
605 | * Note, that in case the state has HRTIMER_STATE_CALLBACK set, no reprogramming | ||
606 | * and no expiry check happens. The timer gets enqueued into the rbtree. The | ||
607 | * reprogramming and expiry check is done in the hrtimer_interrupt or in the | ||
608 | * softirq. | ||
609 | * | ||
605 | * Called with interrupts disabled and base->cpu_base.lock held | 610 | * Called with interrupts disabled and base->cpu_base.lock held |
606 | */ | 611 | */ |
607 | static int hrtimer_reprogram(struct hrtimer *timer, | 612 | static int hrtimer_reprogram(struct hrtimer *timer, |
@@ -662,18 +667,6 @@ static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) | |||
662 | base->hres_active = 0; | 667 | base->hres_active = 0; |
663 | } | 668 | } |
664 | 669 | ||
665 | /* | ||
666 | * When High resolution timers are active, try to reprogram. Note, that in case | ||
667 | * the state has HRTIMER_STATE_CALLBACK set, no reprogramming and no expiry | ||
668 | * check happens. The timer gets enqueued into the rbtree. The reprogramming | ||
669 | * and expiry check is done in the hrtimer_interrupt or in the softirq. | ||
670 | */ | ||
671 | static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, | ||
672 | struct hrtimer_clock_base *base) | ||
673 | { | ||
674 | return base->cpu_base->hres_active && hrtimer_reprogram(timer, base); | ||
675 | } | ||
676 | |||
677 | static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) | 670 | static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) |
678 | { | 671 | { |
679 | ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; | 672 | ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; |
@@ -755,8 +748,8 @@ static inline int hrtimer_is_hres_enabled(void) { return 0; } | |||
755 | static inline int hrtimer_switch_to_hres(void) { return 0; } | 748 | static inline int hrtimer_switch_to_hres(void) { return 0; } |
756 | static inline void | 749 | static inline void |
757 | hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { } | 750 | hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { } |
758 | static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, | 751 | static inline int hrtimer_reprogram(struct hrtimer *timer, |
759 | struct hrtimer_clock_base *base) | 752 | struct hrtimer_clock_base *base) |
760 | { | 753 | { |
761 | return 0; | 754 | return 0; |
762 | } | 755 | } |
@@ -1025,7 +1018,7 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, | |||
1025 | */ | 1018 | */ |
1026 | wake_up_nohz_cpu(new_base->cpu_base->cpu); | 1019 | wake_up_nohz_cpu(new_base->cpu_base->cpu); |
1027 | } else if (new_base->cpu_base == &__get_cpu_var(hrtimer_bases) && | 1020 | } else if (new_base->cpu_base == &__get_cpu_var(hrtimer_bases) && |
1028 | hrtimer_enqueue_reprogram(timer, new_base)) { | 1021 | hrtimer_reprogram(timer, new_base)) { |
1029 | /* | 1022 | /* |
1030 | * Only allow reprogramming if the new base is on this CPU. | 1023 | * Only allow reprogramming if the new base is on this CPU. |
1031 | * (it might still be on another CPU if the timer was pending) | 1024 | * (it might still be on another CPU if the timer was pending) |