aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2007-02-16 04:27:52 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-16 11:13:58 -0500
commit5cfb6de7cd7c8f04655c9d23533ca506647beace (patch)
tree43a43dc7eb95d28befe233080b42a5aceeee5032 /kernel/hrtimer.c
parent303e967ff90a9d19ad3f8c9028ccbfa7f408fbb3 (diff)
[PATCH] hrtimers: clean up callback tracking
Reintroduce ktimers feature "optimized away" by the ktimers review process: remove the curr_timer pointer from the cpu-base and use the hrtimer state. No functional changes. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: john stultz <johnstul@us.ibm.com> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index fee18b27252f..eca0f5593a75 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -172,8 +172,6 @@ static inline int hrtimer_callback_running(struct hrtimer *timer)
172 */ 172 */
173#ifdef CONFIG_SMP 173#ifdef CONFIG_SMP
174 174
175#define set_curr_timer(b, t) do { (b)->curr_timer = (t); } while (0)
176
177/* 175/*
178 * We are using hashed locking: holding per_cpu(hrtimer_bases)[n].lock 176 * We are using hashed locking: holding per_cpu(hrtimer_bases)[n].lock
179 * means that all timers which are tied to this base via timer->base are 177 * means that all timers which are tied to this base via timer->base are
@@ -227,7 +225,7 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base)
227 * completed. There is no conflict as we hold the lock until 225 * completed. There is no conflict as we hold the lock until
228 * the timer is enqueued. 226 * the timer is enqueued.
229 */ 227 */
230 if (unlikely(base->cpu_base->curr_timer == timer)) 228 if (unlikely(timer->state & HRTIMER_STATE_CALLBACK))
231 return base; 229 return base;
232 230
233 /* See the comment in lock_timer_base() */ 231 /* See the comment in lock_timer_base() */
@@ -241,8 +239,6 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base)
241 239
242#else /* CONFIG_SMP */ 240#else /* CONFIG_SMP */
243 241
244#define set_curr_timer(b, t) do { } while (0)
245
246static inline struct hrtimer_clock_base * 242static inline struct hrtimer_clock_base *
247lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) 243lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
248{ 244{
@@ -670,7 +666,6 @@ static inline void run_hrtimer_queue(struct hrtimer_cpu_base *cpu_base,
670 break; 666 break;
671 667
672 fn = timer->function; 668 fn = timer->function;
673 set_curr_timer(cpu_base, timer);
674 __remove_hrtimer(timer, base, HRTIMER_STATE_CALLBACK); 669 __remove_hrtimer(timer, base, HRTIMER_STATE_CALLBACK);
675 spin_unlock_irq(&cpu_base->lock); 670 spin_unlock_irq(&cpu_base->lock);
676 671
@@ -684,7 +679,6 @@ static inline void run_hrtimer_queue(struct hrtimer_cpu_base *cpu_base,
684 enqueue_hrtimer(timer, base); 679 enqueue_hrtimer(timer, base);
685 } 680 }
686 } 681 }
687 set_curr_timer(cpu_base, NULL);
688 spin_unlock_irq(&cpu_base->lock); 682 spin_unlock_irq(&cpu_base->lock);
689} 683}
690 684
@@ -871,8 +865,6 @@ static void migrate_hrtimers(int cpu)
871 spin_lock(&old_base->lock); 865 spin_lock(&old_base->lock);
872 866
873 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { 867 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
874 BUG_ON(old_base->curr_timer);
875
876 migrate_hrtimer_list(&old_base->clock_base[i], 868 migrate_hrtimer_list(&old_base->clock_base[i],
877 &new_base->clock_base[i]); 869 &new_base->clock_base[i]);
878 } 870 }