From nobody Wed Sep 10 02:01:38 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ECD5E7B605 for ; Wed, 4 Oct 2023 12:36:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242463AbjJDMgK (ORCPT ); Wed, 4 Oct 2023 08:36:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242404AbjJDMfo (ORCPT ); Wed, 4 Oct 2023 08:35:44 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC677F0 for ; Wed, 4 Oct 2023 05:35:35 -0700 (PDT) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696422934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pz8RP5Igf6Tpz8GzWwXPtm9q6OrinBuBcc/7z4I5pxE=; b=BOmtu4ivdYU3oYnKkDb5HmQBpDOSvMbX/dkOE0+254ai79drRP/yGbyo9UEPydHO/zVnNu 53pEjywBAMuqf8OQtAnBwuVHO2JCD1u62IQikBtYiR+ALUoPYJxG0X2/LQt2gG0Mv07XwD A8bZHp5I9/zuLlGZt+P/XHY/qcZdq7UGxqp4mGouASlDhToFw2cTAPjDRIs6YMY4+Czodv 1Srrd72499fupEzwkagwz6M8N5hgGh+4XikHbtJwE6ptxPX+g707DMIkjGb/T+e6h+WiE4 j2izWFog0+uPaxcCy0L75B5Qx+c1KSwNwiId4uUHos46AIdl0thPu0qD5F+fxw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696422934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pz8RP5Igf6Tpz8GzWwXPtm9q6OrinBuBcc/7z4I5pxE=; b=V2dSsPDW7CR9I5JAq3+WZfAkcwN/At9CYrDwXDO/EusJ8FoXnZAClGdw4eUR1ozqH1XMvV +/AHhP4uQ+bf3zCQ== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Frederic Weisbecker , Rik van Riel , Steven Rostedt , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak , Anna-Maria Behnsen Subject: [PATCH v8 15/25] timer: Split next timer interrupt logic Date: Wed, 4 Oct 2023 14:34:44 +0200 Message-Id: <20231004123454.15691-16-anna-maria@linutronix.de> In-Reply-To: <20231004123454.15691-1-anna-maria@linutronix.de> References: <20231004123454.15691-1-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Logic for getting next timer interrupt (no matter of recalculated or already stored in base->next_expiry) is split into a separate function "next_timer_interrupt()" to make it available for new call sites. No functional change. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker --- kernel/time/timer.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 1aafa0edc74c..7468a805d302 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1951,14 +1951,20 @@ static u64 cmp_next_hrtimer_event(u64 basem, u64 ex= pires) return DIV_ROUND_UP_ULL(nextevt, TICK_NSEC) * TICK_NSEC; } =20 +static unsigned long next_timer_interrupt(struct timer_base *base) +{ + if (base->next_expiry_recalc) + next_expiry_recalc(base); + + return base->next_expiry; +} + static inline unsigned long __get_next_timer_interrupt(unsigned long basej, struct timer_base *base) { unsigned long nextevt; =20 - if (base->next_expiry_recalc) - next_expiry_recalc(base); - nextevt =3D base->next_expiry; + nextevt =3D next_timer_interrupt(base); =20 if (base->timers_pending) { /* If we missed a tick already, force 0 delta */ --=20 2.39.2