From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F033E3A1CFF for ; Tue, 24 Feb 2026 16:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771950941; cv=none; b=P5oZkTIlJq5SBPhxgBh+qb/eXvt2LG4kT5ho6O8s5KPBqF9lVYKT3Rqulp/gzHvJMUvfjd+YrJxo2ZSKOC+Ym4OMV6zrPQi2al9koWKhqidHIrW0I/Nzh4rgGaUkCUMc+0hhC+qWuoUkoEDBD2ksiJcov9Qs9ry42+WLBYKRU8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771950941; c=relaxed/simple; bh=yUtATDA3cbL1gcCEITRc3Bt1XOGltOBpJJug0T+dz2M=; h=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=d6y3ot4zv9ka9/E9xGBceZSy1UjGJDKmhB8+Sxpc2sK0b7eWpizjmrVJ27YmlX6GlUtMdVD1N6DabqZ+pjADreelvQcq83upCkL2ZMVKySzKJaUBGHl8hBtNYi0qqHodfQENr363scNbDN9Rg/zAh6A0vU2yxb+4NAGxU2Ko+Sw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oRuFTbGB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oRuFTbGB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48816C116D0; Tue, 24 Feb 2026 16:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771950940; bh=yUtATDA3cbL1gcCEITRc3Bt1XOGltOBpJJug0T+dz2M=; h=Date:From:To:Cc:Subject:References:From; b=oRuFTbGBpxNOP7Q6/yqQaWtuztWnsLcW8pE7XvWfmTQc3oCEfJaN0aZ/cFuE7Hknd evqZ1toLG16JTccMwhwGgkO8g4FcUjAQ243UlqxqhIrx3TiUP+AMUEmmkMKXV1JCgm wd0N0rFK2JGOERydWAYnVMGgc6bPk+z/yR51Odj8Ee+yhDoCywRFHoxQUhZqtIV+yZ S+AfeA3u6cckh6a0eBBLnhWFzWqWzSmxRp4vrVegv2vATgNCMAcMQBEfyPd0upcAZ7 UdcO6bP9cLe8JQtQemys7Wh1Rkc02Thz0Tv8areelRmc6+A+Y8JUWvG+AwkDl4s6Mr ojQGFB7FgTkug== Date: Tue, 24 Feb 2026 17:35:37 +0100 Message-ID: <20260224163429.069535561@kernel.org> User-Agent: quilt/0.68 From: Thomas Gleixner To: LKML Cc: Anna-Maria Behnsen , John Stultz , Stephen Boyd , Daniel Lezcano , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , x86@kernel.org, Peter Zijlstra , Frederic Weisbecker , Eric Dumazet Subject: [patch 05/48] hrtimer: Avoid pointless reprogramming in __hrtimer_start_range_ns() References: <20260224163022.795809588@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: Peter Zijlstra Much like hrtimer_reprogram(), skip programming if the cpu_base is running the hrtimer interrupt. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Reviewed-by: Juri Lelli Reviewed-by: Thomas Gleixner --- kernel/time/hrtimer.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1269,6 +1269,14 @@ static int __hrtimer_start_range_ns(stru } first = enqueue_hrtimer(timer, new_base, mode); + + /* + * If the hrtimer interrupt is running, then it will reevaluate the + * clock bases and reprogram the clock event device. + */ + if (new_base->cpu_base->in_hrtirq) + return false; + if (!force_local) { /* * If the current CPU base is online, then the timer is