[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1609997600-13503-1-git-send-email-lirongqing@baidu.com>
Date: Thu, 7 Jan 2021 13:33:20 +0800
From: Li RongQing <lirongqing@...du.com>
To: linux-kernel@...r.kernel.org, john.stultz@...aro.org,
tglx@...utronix.de
Subject: [PATCH] alarmtimer: Do not mess with an enqueued hrtimer
when an hrtimer is enqueued already, its expires should be not
changed, otherwise, this will corrupts the ordering of the
timerqueue RB tree, if other hrtimer is enqueued before this
hrtimer is restarted, whole RB tree is completely hosed
Fixes: 6cffe00f7d4e ("alarmtimer: Add functions for timerfd support")
Signed-off-by: Li RongQing <lirongqing@...du.com>
---
kernel/time/alarmtimer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index f4ace1bf8382..3b34995ab8d2 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -388,8 +388,7 @@ void alarm_restart(struct alarm *alarm)
unsigned long flags;
spin_lock_irqsave(&base->lock, flags);
- hrtimer_set_expires(&alarm->timer, alarm->node.expires);
- hrtimer_restart(&alarm->timer);
+ hrtimer_start(&alarm->timer, alarm->node.expires, HRTIMER_MODE_ABS);
alarmtimer_enqueue(base, alarm);
spin_unlock_irqrestore(&base->lock, flags);
}
--
2.17.3
Powered by blists - more mailing lists