From patchwork Fri Dec 1 09:26:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 172349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp991742vqy; Fri, 1 Dec 2023 01:28:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAtl+btLsIUgNevoDh26Mqoo4B5XnOMWxqJkq62LsUxC14X/Cqq7jpj3TrlktidYikZ+RF X-Received: by 2002:a05:6a20:2451:b0:18b:8475:410a with SMTP id t17-20020a056a20245100b0018b8475410amr30500833pzc.7.1701422879725; Fri, 01 Dec 2023 01:27:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701422879; cv=none; d=google.com; s=arc-20160816; b=UyYZmjmgN1GCRZoq0F1aOce3/Z4GTW4HANNQJMI4B/PqGEeHP5HcV8wYXWOltwdbCN PBDfueIRnPErblWNW4Koh467whN4ux0UPTaPj7LuE747HBOM/h6vVRtoi1kYTIIs+5BZ 7FwwfvPi39ppe+/tdWlh02y2461NaHN5M9etpnhhsz+LkmR7tSUzQCrQf9iWMzSwRBOy xbJcAl+irfFCSz4Llfor49HqXa1DApVm4B62jX/Q2cBBrChNawFlyySVgmzMexcc7NZ7 uLK8wCpMuTvXjHtSCixYX9mCNfU2nV+oe9LGt7WoZov4AXBiomlbGiug/pEghrUYueYx ZBqg== 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=eWAzXEfpMywLlqp587KxIHRrk44Rp7dtxL6JlN1/eF4=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=Ti+vP5h1fXUeh6tt3wMvrwdv2J1H1FsSyy0mk5EI09VssM5hG7puToJqgEoLNwB3hm V6YSbmSYbWlnxoZVkKgLGJUm1ImEKMWfsZYfzO9YQqUqkqcEdK7S66+3tFItqs5aKRY3 Zx2Kdt/KqRUz9UoR9qsyMEWaAN7Ii6vd6x62HQ5c3Na4GP8bplBFzGQv8DOioqOi0us9 alT8Q5KyAfBjQjmGy6jne7ZrbmH8EWuvnhyfFgjCUfHS6Cf5hVKudWLBw++L0qfVxpxq 28D4mGN1vz6QDfXJzwfCz8gtMPqXae3awfl4KXADIPAuozYUMRXqohB8Su+TR3hJsUEm sQwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nrPDcWG6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id pj11-20020a17090b4f4b00b0027739322ce2si3285757pjb.100.2023.12.01.01.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:27:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nrPDcWG6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7DEBD80EA97D; Fri, 1 Dec 2023 01:27:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378109AbjLAJ1j (ORCPT + 99 others); Fri, 1 Dec 2023 04:27:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378047AbjLAJ1W (ORCPT ); Fri, 1 Dec 2023 04:27:22 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7992E172E for ; Fri, 1 Dec 2023 01:27:16 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701422835; 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=eWAzXEfpMywLlqp587KxIHRrk44Rp7dtxL6JlN1/eF4=; b=nrPDcWG6y+EdgnAwLZJrMGEaTSj4fpLZbHu1F5MYX4pNfm8XwdDmfbaq3+Qfw75U13WXlN Wn/03lvZN5wgl5keYEfUyqe+Ren56ovfCTN73gvsCHyVcgnrOaxR6UU35FeZKoPn9cXLqx HnQJ41b5XrnUqb9KygJlhKObBRbD0CBisK8MgF7pi4EzW1AySz6TKSzWbQeWz/O25sSOGI mUcxSvIcwOCrfPKPMKcjfpRPDQXVMO/6pXJSNwHje+BVCkdOMwdyCG52Y5obMfOKXuqsrz xPK5vVvU53qVkzQ12pNGeND+dF67+YhA8Kfco1uSKz+rFzdJHkWzTHobUjGZJg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422835; 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=eWAzXEfpMywLlqp587KxIHRrk44Rp7dtxL6JlN1/eF4=; b=ejl4p2jWf2hUodAxU46BdlFPsS0jUview2NzC2fTxisTms7SzXjFDnFPfiT065gMEKHznq UDzdpbW485YF6UAw== 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 13/32] timers: Restructure get_next_timer_interrupt() Date: Fri, 1 Dec 2023 10:26:35 +0100 Message-Id: <20231201092654.34614-14-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 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:27:54 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784071197149846098 X-GMAIL-MSGID: 1784071197149846098 get_next_timer_interrupt() contains two parts for the next timer interrupt calculation. Those two parts are separated by forwarding the base clock. But the second part does not depend on the forwarded base clock. Therefore restructure get_next_timer_interrupt() to keep things together which belong together. No functional change. Signed-off-by: Anna-Maria Behnsen --- v9: New patch to eases patch "timers: Split out get next timer functionality" --- kernel/time/timer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 4dffe966424c..9d377ebb7395 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1936,12 +1936,6 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) if (base->next_expiry_recalc) next_expiry_recalc(base); - /* - * We have a fresh next event. Check whether we can forward the - * base. - */ - __forward_timer_base(base, basej); - if (base->timers_pending) { nextevt = base->next_expiry; @@ -1959,6 +1953,12 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) base->next_expiry = nextevt; } + /* + * We have a fresh next event. Check whether we can forward the + * base. + */ + __forward_timer_base(base, basej); + /* * Base is idle if the next event is more than a tick away. *