From patchwork Fri Dec 1 09:26:32 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: 172353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp991889vqy; Fri, 1 Dec 2023 01:28:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWlwpdMZzUDR6OT1Zl4EgDx6VyM7QnN6DY6+//Cmt9ZEnwZAKBzhRZA/5a/ZhVaGYG2pdK X-Received: by 2002:a05:6830:1301:b0:6d8:551d:5b4e with SMTP id p1-20020a056830130100b006d8551d5b4emr2352908otq.20.1701422900481; Fri, 01 Dec 2023 01:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701422900; cv=none; d=google.com; s=arc-20160816; b=ZPocAQpky4XNiCqJqNQaa1K343LwfK6IfLzocpYRkMaXwd7GRAVVeAPb/yHw4Gw7lU X/wWTVfBrc0naKl3M/XJ1tZ5HRLAUcEIuDdpfkIC25pGjk8coeZVkTuRL6Po8T53XYHy y5OlqENBBo4QRfro5eykk+vavME99XjgxIQmuutG4iElOR08FlLxnTw4MgAf0F89rfGj gBkg324TWsr6m+rW24utzbkfRDyvKA6jRl5c9BDU/ePWTK3TMrOvg7yg0jQ8hG3oyqu0 kq6zzA19bUWRlCLcOjING/tJbpgm263xkD4CyOSLH/NV97emS7GMcfLbpXgfi9rHs/q1 2wgQ== 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=+S43URzdkm4GE5deeh35HedlVNn9pKmfGb0vCPSVNJU=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=illFZeIdX4SBbPItG7ViOf/xAwCEogbZTIMN6grhVLed4ItWAxR5kYoKAXvSXQ9rt6 TzAKZRpeWPzcG7reMQ+u6jN61iThpRZBY7z+wnk/yB4b8K5UAlli1znpFeBMP3rIWDcb SsTR4oA24Ya6+k0eP50ayGP8581CqDNI0S4ubBexr/jQhvx2caKcgPxw8uXSXwjMBZcE kqejzwYgll9gfaDMJvHKsxUGfRZgIU6zumtFLEQlehjiePRk0CiOuRO5U+MPjnNaDTCj yP0/5pSlMrAZg2Dmk6y0xzmzV9Hpi+f2jHFKsp4pAGTQeaoVjLZ3FRm86Ee29boJxspa VOCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=el5AdGLC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=HxtFSzHB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id g10-20020a656cca000000b005c5e2967758si3230998pgw.671.2023.12.01.01.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:28:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=el5AdGLC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=HxtFSzHB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 052AD83D9B66; Fri, 1 Dec 2023 01:28:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378104AbjLAJ1f (ORCPT + 99 others); Fri, 1 Dec 2023 04:27:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378065AbjLAJ1U (ORCPT ); Fri, 1 Dec 2023 04:27:20 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A8B171A for ; Fri, 1 Dec 2023 01:27:14 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701422833; 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=+S43URzdkm4GE5deeh35HedlVNn9pKmfGb0vCPSVNJU=; b=el5AdGLCIQZcbBus9nb/xgs+vY+Tv76/155OcrpNkNOjUWHu2Iay04ijEup/CZKYAfF+qh sLqmjFN9GHKVRUzf9cRZklprE52pJ9L8kUfKjnGdDNVQK2XqUFEQ+6+hzipfaedbaRthZm 6Kl2Obge+HPzfqeWxSHmaScooCQbrXk8SOQ3Ik/mN0vTv4iSaOEZbdKEONwbdxIV5BJU/E WNrcDanyKol7UClRMoZbNgCpdqMNa08bdC3xYLNna5+c2HQf/8kKGMT+GtVdqx2WIXo3RJ RgKdDCKh3NQUBx0fiAdJKLos3M2mXq790/QjjGt3MOHAEXZREpaJo/p+qtLbPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422833; 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=+S43URzdkm4GE5deeh35HedlVNn9pKmfGb0vCPSVNJU=; b=HxtFSzHBtGc0DacUydRzFJpAQaTMJ4mc5tul79/rcY9HP9L9pECbfeBHsmnvjQJFudbZJQ DO5tluaLRIL1/YCA== 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 10/32] timers: Use already existing function for forwarding timer base Date: Fri, 1 Dec 2023 10:26:32 +0100 Message-Id: <20231201092654.34614-11-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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:28:14 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784071219155282403 X-GMAIL-MSGID: 1784071219155282403 There is an already existing function for forwarding the timer base. Forwarding the timer base is implemented directly in get_next_timer_interrupt() as well. Remove the code duplication and invoke __forward_timer_base() instead. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Frederic Weisbecker --- kernel/time/timer.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index e289cbd84e8c..fee42dda8237 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1939,15 +1939,9 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) /* * We have a fresh next event. Check whether we can forward the - * base. We can only do that when @basej is past base->clk - * otherwise we might rewind base->clk. + * base. */ - if (time_after(basej, base->clk)) { - if (time_after(nextevt, basej)) - base->clk = basej; - else if (time_after(nextevt, base->clk)) - base->clk = nextevt; - } + __forward_timer_base(base, basej); if (time_before_eq(nextevt, basej)) { expires = basem;