From nobody Sun Feb 8 21:47:17 2026 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 5762B392C44 for ; Wed, 21 Jan 2026 16:28:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769012886; cv=none; b=acwvjRFzeRXLB2CDi/jp4v24SRxgdKqX9MfGW/5eYBsrpE0asff/RZ68pQWemFcNGWRS7Ecriy0TOQzZCviFrbp66231KJ2TfQ9F1fS4eSnvemZl65EvRANX0XDxb/RvlHr6u+u/cXK7YkYbcx59i/4KH55Enxg3gEbszS+2BFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769012886; c=relaxed/simple; bh=R0EtHI742GZCTWZUDFegChs24SN0RP0BIfIUeuIPh1g=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=nJjac56wnvRW/qKtuvxHgvrrbkR5YnCS7+HxlxFwBjwv2uIsNEJExqHbGSJnafEvMdyXmqic2QJclVdxH/n/P/I3cfugiAyvHH5P3qMUtu9NDaPHYcAzNLp8xI72gdchltx6fGpvfXANbesv4kkEGt9u9Y3EpNuwEo9puqGs0RA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=pgS/zjnS; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pgS/zjnS" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=tvvsM4kL8n8wd6yKl1nxlLNT9z4fxtjHxXhTPLGstbo=; b=pgS/zjnSimW+j5uOy+4K0aydTV rrWL4yDHLTOdxQ3POj72f74i6hsVuw6KjzVS9/0DtKuLBnv6Oe8JuflQ/Dc+xDuERuKEOovv5sE3O BoygO54j6SIFLnPMMx0meWqjEyb6F0hhNAxe0g9HfQBrRSOXICbKxoUf3a6NLhD/7dnpHRjml690u PHI0kz96LBsfwrhT/1+L7oWUOH8a4OSMzq5u5JuPoTcgEmo8iqCj3Dr85+ktMX8uGmwj3keoMyB0C 1nuKGh5L0+3hY11BpzWeNKkxui4TtHsNC0HLn2AF4nbs09Jff90uW+odpHAUV7curw5CxncGa+V/Q oCSDIcLQ==; Received: from 2001-1c00-8d85-5700-266e-96ff-fe07-7dcc.cable.dynamic.v6.ziggo.nl ([2001:1c00:8d85:5700:266e:96ff:fe07:7dcc] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vib3l-0000000GOpP-0WQZ; Wed, 21 Jan 2026 16:27:57 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id D783E3007E1; Wed, 21 Jan 2026 17:27:55 +0100 (CET) Message-ID: <20260121162507.643471683@infradead.org> User-Agent: quilt/0.68 Date: Wed, 21 Jan 2026 17:20:12 +0100 From: Peter Zijlstra To: tglx@linutronix.de Cc: arnd@arndb.de, anna-maria@linutronix.de, frederic@kernel.org, peterz@infradead.org, luto@kernel.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, oliver.sang@intel.com Subject: [PATCH v2 2/6] hrtimer: Optimize __hrtimer_start_range_ns() References: <20260121162010.647043073@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Much like hrtimer_reprogram(), skip programming if the cpu_base is running the hrtimer interrupt. Signed-off-by: Peter Zijlstra (Intel) 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 @@ -1261,6 +1261,14 @@ static int __hrtimer_start_range_ns(stru } =20 first =3D 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 0; + if (!force_local) { /* * If the current CPU base is online, then the timer is