aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 065a89786628..eb1ddebd2c04 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -686,6 +686,7 @@ static void enqueue_hrtimer(struct hrtimer *timer,
686 struct rb_node **link = &base->active.rb_node; 686 struct rb_node **link = &base->active.rb_node;
687 struct rb_node *parent = NULL; 687 struct rb_node *parent = NULL;
688 struct hrtimer *entry; 688 struct hrtimer *entry;
689 int leftmost = 1;
689 690
690 /* 691 /*
691 * Find the right place in the rbtree: 692 * Find the right place in the rbtree:
@@ -697,18 +698,19 @@ static void enqueue_hrtimer(struct hrtimer *timer,
697 * We dont care about collisions. Nodes with 698 * We dont care about collisions. Nodes with
698 * the same expiry time stay together. 699 * the same expiry time stay together.
699 */ 700 */
700 if (timer->expires.tv64 < entry->expires.tv64) 701 if (timer->expires.tv64 < entry->expires.tv64) {
701 link = &(*link)->rb_left; 702 link = &(*link)->rb_left;
702 else 703 } else {
703 link = &(*link)->rb_right; 704 link = &(*link)->rb_right;
705 leftmost = 0;
706 }
704 } 707 }
705 708
706 /* 709 /*
707 * Insert the timer to the rbtree and check whether it 710 * Insert the timer to the rbtree and check whether it
708 * replaces the first pending timer 711 * replaces the first pending timer
709 */ 712 */
710 if (!base->first || timer->expires.tv64 < 713 if (leftmost) {
711 rb_entry(base->first, struct hrtimer, node)->expires.tv64) {
712 /* 714 /*
713 * Reprogram the clock event device. When the timer is already 715 * Reprogram the clock event device. When the timer is already
714 * expired hrtimer_enqueue_reprogram has either called the 716 * expired hrtimer_enqueue_reprogram has either called the