diff options
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r-- | kernel/hrtimer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 72d034258ba1..eb1ddebd2c04 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -558,7 +558,8 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, | |||
558 | */ | 558 | */ |
559 | static int hrtimer_switch_to_hres(void) | 559 | static int hrtimer_switch_to_hres(void) |
560 | { | 560 | { |
561 | struct hrtimer_cpu_base *base = &__get_cpu_var(hrtimer_bases); | 561 | int cpu = smp_processor_id(); |
562 | struct hrtimer_cpu_base *base = &per_cpu(hrtimer_bases, cpu); | ||
562 | unsigned long flags; | 563 | unsigned long flags; |
563 | 564 | ||
564 | if (base->hres_active) | 565 | if (base->hres_active) |
@@ -568,6 +569,8 @@ static int hrtimer_switch_to_hres(void) | |||
568 | 569 | ||
569 | if (tick_init_highres()) { | 570 | if (tick_init_highres()) { |
570 | local_irq_restore(flags); | 571 | local_irq_restore(flags); |
572 | printk(KERN_WARNING "Could not switch to high resolution " | ||
573 | "mode on CPU %d\n", cpu); | ||
571 | return 0; | 574 | return 0; |
572 | } | 575 | } |
573 | base->hres_active = 1; | 576 | base->hres_active = 1; |
@@ -683,6 +686,7 @@ static void enqueue_hrtimer(struct hrtimer *timer, | |||
683 | struct rb_node **link = &base->active.rb_node; | 686 | struct rb_node **link = &base->active.rb_node; |
684 | struct rb_node *parent = NULL; | 687 | struct rb_node *parent = NULL; |
685 | struct hrtimer *entry; | 688 | struct hrtimer *entry; |
689 | int leftmost = 1; | ||
686 | 690 | ||
687 | /* | 691 | /* |
688 | * Find the right place in the rbtree: | 692 | * Find the right place in the rbtree: |
@@ -694,18 +698,19 @@ static void enqueue_hrtimer(struct hrtimer *timer, | |||
694 | * We dont care about collisions. Nodes with | 698 | * We dont care about collisions. Nodes with |
695 | * the same expiry time stay together. | 699 | * the same expiry time stay together. |
696 | */ | 700 | */ |
697 | if (timer->expires.tv64 < entry->expires.tv64) | 701 | if (timer->expires.tv64 < entry->expires.tv64) { |
698 | link = &(*link)->rb_left; | 702 | link = &(*link)->rb_left; |
699 | else | 703 | } else { |
700 | link = &(*link)->rb_right; | 704 | link = &(*link)->rb_right; |
705 | leftmost = 0; | ||
706 | } | ||
701 | } | 707 | } |
702 | 708 | ||
703 | /* | 709 | /* |
704 | * Insert the timer to the rbtree and check whether it | 710 | * Insert the timer to the rbtree and check whether it |
705 | * replaces the first pending timer | 711 | * replaces the first pending timer |
706 | */ | 712 | */ |
707 | if (!base->first || timer->expires.tv64 < | 713 | if (leftmost) { |
708 | rb_entry(base->first, struct hrtimer, node)->expires.tv64) { | ||
709 | /* | 714 | /* |
710 | * Reprogram the clock event device. When the timer is already | 715 | * Reprogram the clock event device. When the timer is already |
711 | * expired hrtimer_enqueue_reprogram has either called the | 716 | * expired hrtimer_enqueue_reprogram has either called the |