From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 27D83364EB0; Wed, 20 May 2026 17:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779297453; cv=none; b=nltAYG98GpnGknusjA4MsTrUth0cKrZRSjdOlZUXy9MqcXwd0LmmguZ7kzZa5Gb3J6daE8Pe4cOCsrfktbDy827iXu35MK1RBKlazIbKh+hkHdGhroHVUA8/ktGKVlFM0UN9vktuJBZTNMov1fDLtRV+uhmWzKEmHP89YLkv2Sw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779297453; c=relaxed/simple; bh=2deQYH7ZM+D/9zmealSKQ8dhGSuQoWsIlCqPtHvb1K8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e9EY50Nqm5s97QBnOZM/UbFoDMFpeVN43tHNMYQc8sT4g018/+DOc1NCODumJGYu9Y2xocqVzjlgu5e+bu1w+ASMfCI3RcHNt6RSIwjnx1Dpb6xjWWQQ3bD/1od0X8WnDJOJe+tdKvoOJRUpe4bKlahhuQNUrrzk2GlbXKJ7fyY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Gr9WS9Uu; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Gr9WS9Uu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B2761F000E9; Wed, 20 May 2026 17:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779297452; bh=zVYmyxPHKIaoOCTmWZ9Z5yTPSie9uLhQVnbwm1d5WPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Gr9WS9Uu5v38UELkBJdVpU18XlFGLPEhDjBqkcLu5fJYt3slFKOHHyRZqeXzj3Osk cixBMmbW+kfQFdGAedpM0raHS8GjoKzAfF04mWJ5yTlsyJ8/BjP663t2/1h3FRQBLO SsvkJvhVjVAHzLlQ0tYkApA9GX6qwnz4x1NOUs1U= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Peter Zijlstra (Intel)" , Thomas Gleixner , Juri Lelli , Sasha Levin Subject: [PATCH 6.18 036/957] hrtimer: Avoid pointless reprogramming in __hrtimer_start_range_ns() Date: Wed, 20 May 2026 18:08:39 +0200 Message-ID: <20260520162135.341520547@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162134.554764788@linuxfoundation.org> References: <20260520162134.554764788@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Zijlstra [ Upstream commit d19ff16c11db38f3ee179d72751fb9b340174330 ] 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Juri Lelli Reviewed-by: Thomas Gleixner Link: https://patch.msgid.link/20260224163429.069535561@kernel.org Stable-dep-of: f2e388a019e4 ("hrtimer: Reduce trace noise in hrtimer_start()") Signed-off-by: Sasha Levin --- kernel/time/hrtimer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 21b6d93401480..2589cd1b2ec3a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1261,6 +1261,14 @@ static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, } 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 -- 2.53.0