From patchwork Tue Oct 25 13:58:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 10793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1023463wru; Tue, 25 Oct 2022 07:01:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4rWnbV2gic/bk6yp4/VljROWttr+HNrIKP9UNia0zln+NkvN8lBK+/OOAs3emMpycddpdS X-Received: by 2002:a17:90b:1e0c:b0:20f:bcbf:ab5 with SMTP id pg12-20020a17090b1e0c00b0020fbcbf0ab5mr43344352pjb.187.1666706485025; Tue, 25 Oct 2022 07:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666706485; cv=none; d=google.com; s=arc-20160816; b=iZ1DuaImR/ACYDFWc0eue8J8fg9PGIiwkpkX4D+5bPg7GmfSvAm5whytNmPjcJrhgk S+sowRscTDwuaNRDqOgZxaJY/NCjP9M95sW4lmVGqGVdyI06mg1c3FOAbyoaze1icQgt LhH3qRRJL9KTWU513v1ZJ9q53w689UYNDwuoHx3nsz3w85ActDux5C5aBxXcphzBbE/j Hux6W1Rpx3mH7ZB4ClP0OPoZHXZVWW7sTdwwnczuzHjAV1kJ6YSdscy5/DbGFRH0Ip8V 9FCoQtbm5wF3aTLSmFHCDlDqg8Id4fh7ezlVhDE5ns/mMxLx3meWxx9HndIX2l2mYp4X keKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=l3DckWoO10WRg2UnQ17gmGvcP+Cj39tE06wtS471Li8=; b=dPh5uweNIpJZzE5Y2t/+9cP5CH4LimLBTmvMgIS16OgnJkoZlUnY326GkQB4kQoe5H xF803rWeocw3hcoJjnp6Ug3SEzHW+xm6S3T4ZlZY43yT8FwdNXoHGiROlETi0Ol4C/eG KTbRoC31p4a1WXMWTlUMDikek/VPXSj+ZaVNYBB1ySKphOfu78SFHiRljqeuvQIjKbTl PnJhwDlOw6w5ot0cP/1UiSglEKd2hOX3DOpjm1mBHMv0piAb7Zg9SF0DurPBJ05bbZiY AHwZmCbP+IGJ72w/K695An7FwYDh6fnqTe7QWhIoGDqYzAAzypFpxisMw+njoBRjMp6w +Fng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=em6zftEa; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a63db45000000b0043cb5d08908si3104225pgi.138.2022.10.25.07.01.09; Tue, 25 Oct 2022 07:01:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=em6zftEa; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232327AbiJYN7t (ORCPT + 99 others); Tue, 25 Oct 2022 09:59:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbiJYN7Z (ORCPT ); Tue, 25 Oct 2022 09:59:25 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A17AD18A03B; Tue, 25 Oct 2022 06:59:23 -0700 (PDT) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666706362; 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=l3DckWoO10WRg2UnQ17gmGvcP+Cj39tE06wtS471Li8=; b=em6zftEaoVI3HcNeSkFX3GvNS7Mq87YKqxPi6jzPuNuMnsd9hOpgXqU7YxHKnOnE0H2Ufu sMMiJ3fP/8URs7IkpEbXMveDREe9Xgh6xeGoiBBECWHhoneW8CwhTfZ7ZfxLHfNyhDZlj2 byidkY6FCvMadm7QpHIlKqV+AjY7oxRV3K72azJSsMGdosRYL5uomyDcy9PeuyAJ93ZXZs SetjXxk2RaAkHdrysvgQd+ms+lQVxFnRIzqoCkh6xwgcvMsyEVqML/rFdUokeLBy2A9x1J uahbz5O8/T4v4H3Ipi+mvXlTfVD0H6r+Gp17i4lkUIKiC2blUUr0Q5p3xhGKtg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666706362; 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=l3DckWoO10WRg2UnQ17gmGvcP+Cj39tE06wtS471Li8=; b=vp4yKAYpyd4o5LxaF5jjMGHvfVD89NYnRkiFrZ1e/WQoU6DXiDUEbm31y9dPKO9NE6TBLM vFUfK3nSHkMMU3Dw== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , John Stultz , Eric Dumazet , Thomas Gleixner , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Arjan van de Ven , "Paul E. McKenney" , Frederic Weisbecker , Rik van Riel , Anna-Maria Behnsen Subject: [PATCH v3 03/17] timer: Move store of next event into __next_timer_interrupt() Date: Tue, 25 Oct 2022 15:58:36 +0200 Message-Id: <20221025135850.51044-4-anna-maria@linutronix.de> In-Reply-To: <20221025135850.51044-1-anna-maria@linutronix.de> References: <20221025135850.51044-1-anna-maria@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747668418999273730?= X-GMAIL-MSGID: =?utf-8?q?1747668418999273730?= Both call sides of __next_timer_interrupt() store the return value directly in base->next_expiry. Move the store into __next_timer_interrupt(). No functional change. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Thomas Gleixner --- kernel/time/timer.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 717fcb9fb14a..7695c733dfa5 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1571,8 +1571,10 @@ static int next_pending_bucket(struct timer_base *base, 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_timer_interrupt(struct timer_base *base) { unsigned long clk, next, adj; unsigned lvl, offset = 0; @@ -1638,10 +1640,11 @@ static unsigned long __next_timer_interrupt(struct timer_base *base) clk += adj; } + base->next_expiry = next; base->next_expiry_recalc = false; base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA); - return next; + return; } #ifdef CONFIG_NO_HZ_COMMON @@ -1701,7 +1704,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) raw_spin_lock(&base->lock); if (base->next_expiry_recalc) - base->next_expiry = __next_timer_interrupt(base); + __next_timer_interrupt(base); nextevt = base->next_expiry; /* @@ -1784,7 +1787,7 @@ static inline void __run_timers(struct timer_base *base) WARN_ON_ONCE(!levels && !base->next_expiry_recalc && base->timers_pending); base->clk++; - base->next_expiry = __next_timer_interrupt(base); + __next_timer_interrupt(base); while (levels--) expire_timers(base, heads + levels);