Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp69130pxu; Wed, 6 Jan 2021 21:44:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+2TzmTenHlin5u2S4hqDoei6pR/WPVmai4Hb8e5WTMcQ/MhGHtx+H637MjK3ESBW3nhOv X-Received: by 2002:a50:f9cc:: with SMTP id a12mr388380edq.335.1609998281249; Wed, 06 Jan 2021 21:44:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609998281; cv=none; d=google.com; s=arc-20160816; b=R7dGH6L75ZEpPHHdMoX7pvyQPMRGEZLE1hseFt9ehpR7r0yoylExilbVvzJbXmffYj FLSeB53F8KIIRTFMvPAFb8qDAbcyDCxo6t52kyeMO9fhxGh8PAnveVzIPY9nr6SwWVlV bIdmk5d6q3boAdldf/QY4TEuPkPNBUrjihtc/hwsI5Gjsqnh4X/kq63muzSJAol/CKKw 5uuBIGe//YNezm4+2f1u4JaP0LfRqQbsJbMDrCTLvv9KM+hFIYsA1NCCEBaZArdVBUDs LEDSRMb3+0tW0EF1qwlD4gia10u8Z4LnYA5WWmTwSCCi5uLI3KUppdF8/QtE599G74ex TjqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=geusYE/JX+0e33f07bnVSdVe38T6RyHVLStVGbpKVlI=; b=BfKsdg7WTk/Ag0NLODAS64oQm9BZ1NRa9OseC768uMmpp2aZ/5DlwvVBVjKow9LHev wvBrMaBRZsrsGDwrIahzQg1QBOiubWHnJMUxTD6rnQrbweGjZSRhY7Q5dzJO7m2NXP+K M99yNprflUu9YB1uLuPWIomuLeLXzW9UGCPjwvntpsAZS5ktBlB23FEJQ0RWDqHfUM70 07F74tX8dkX6UuUOpUJWOHLtbILD+jTedkSkyE3uzy4KvpXAgkjzUitfnt00aMp7ikY+ GeAnkUaNMndMZ0uehGKtXBC2Dl7j3R9w8dRtJbhjgk1mOnlcR+rVjrEjUDtjTbVkfdDl h2ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si1821417ejo.26.2021.01.06.21.44.17; Wed, 06 Jan 2021 21:44:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726293AbhAGFlv (ORCPT + 99 others); Thu, 7 Jan 2021 00:41:51 -0500 Received: from mx433.baidu.com ([119.249.100.169]:52089 "EHLO dbl-sys-mailin03.dbl01.baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726110AbhAGFlv (ORCPT ); Thu, 7 Jan 2021 00:41:51 -0500 X-Greylist: delayed 458 seconds by postgrey-1.27 at vger.kernel.org; Thu, 07 Jan 2021 00:41:50 EST Received: from bjhw-sys-rpm015653cc5.bjhw.baidu.com (unknown [10.172.107.253]) by dbl-sys-mailin03.dbl01.baidu.com (Postfix) with ESMTP id 2DC8F16E00057; Thu, 7 Jan 2021 13:33:20 +0800 (CST) From: Li RongQing To: linux-kernel@vger.kernel.org, john.stultz@linaro.org, tglx@linutronix.de Subject: [PATCH] alarmtimer: Do not mess with an enqueued hrtimer Date: Thu, 7 Jan 2021 13:33:20 +0800 Message-Id: <1609997600-13503-1-git-send-email-lirongqing@baidu.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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