From nobody Mon Dec 29 05:02:34 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 D0E0CC4167B for ; Fri, 1 Dec 2023 09:27:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378095AbjLAJ1c (ORCPT ); Fri, 1 Dec 2023 04:27:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378033AbjLAJ1G (ORCPT ); Fri, 1 Dec 2023 04:27:06 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 582C510F3 for ; Fri, 1 Dec 2023 01:27:12 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701422830; 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=abaveLygv3WKLQ70azOX5Nhmi35F03D2H7Exz6wvRjs=; b=a1nd9r7lEBC9ci6wUVUgi1hN4JCBZlGitekHspDsibrFdu+pl6/3sTyy+324ahw5Rz8T2d uZTYVbFq3MMn/Aork8Mx5jwoQm179AXqZBvu+n7AGwyQykOZik6lmJ1xXTsu7yTmC/HkdF 52j3JYYAPDW4Jg3KME89B0f6l7d6zprctDbQgkcff1pjV5mC/jwRLOLQoZ3LolluWMH1mH YXyx1z+xAybkeuZWQL3+Nc/UPifl2f29OmDqW1J2HjXXELtCOe0OrwmJDsD96TOeH86fTW Sx8OSCuD5mmbxt7QitqcraPf+7fQ+bdykkWeOR1RtVUiv6anLw2D4wUnaXBKgw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422830; 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=abaveLygv3WKLQ70azOX5Nhmi35F03D2H7Exz6wvRjs=; b=e0qcp8TwrijRK7VdVHlEYhM6yUkMF56vK2jMfSzEgzTaI8OYcOICJciV0hJSwlLduf3n9/ MRWLn7kdMu364XBA== 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 v9 07/32] timers: Move store of next event into __next_timer_interrupt() Date: Fri, 1 Dec 2023 10:26:29 +0100 Message-Id: <20231201092654.34614-8-anna-maria@linutronix.de> In-Reply-To: <20231201092654.34614-1-anna-maria@linutronix.de> References: <20231201092654.34614-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" Both call sites of __next_timer_interrupt() store the return value directly in base->next_expiry. Move the store into __next_timer_interrupt() and to make its purpose more clear, rename the function to next_expiry_recalc(). No functional change. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker --- v9: Typo fix only v6: Fix typos in commit message and drop not required return as suggested by Peter Zijlstra v4: rename function as suggested by Frederic Weisbecker --- kernel/time/timer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index a6e31b09637c..3ca706db1d20 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1800,8 +1800,10 @@ static int next_pending_bucket(struct timer_base *ba= se, unsigned offset, /* * Search the first expiring timer in the various clock levels. Caller must * hold base->lock. + * + * Store next expiry time in base->next_expiry. */ -static unsigned long __next_timer_interrupt(struct timer_base *base) +static void next_expiry_recalc(struct timer_base *base) { unsigned long clk, next, adj; unsigned lvl, offset =3D 0; @@ -1867,10 +1869,9 @@ static unsigned long __next_timer_interrupt(struct t= imer_base *base) clk +=3D adj; } =20 + base->next_expiry =3D next; base->next_expiry_recalc =3D false; base->timers_pending =3D !(next =3D=3D base->clk + NEXT_TIMER_MAX_DELTA); - - return next; } =20 #ifdef CONFIG_NO_HZ_COMMON @@ -1930,7 +1931,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64= basem) =20 raw_spin_lock(&base->lock); if (base->next_expiry_recalc) - base->next_expiry =3D __next_timer_interrupt(base); + next_expiry_recalc(base); nextevt =3D base->next_expiry; =20 /* @@ -2015,7 +2016,7 @@ static inline void __run_timers(struct timer_base *ba= se) WARN_ON_ONCE(!levels && !base->next_expiry_recalc && base->timers_pending); base->clk++; - base->next_expiry =3D __next_timer_interrupt(base); + next_expiry_recalc(base); =20 while (levels--) expire_timers(base, heads + levels); --=20 2.39.2