Message ID | 20231004123454.15691-16-anna-maria@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp98637vqb; Wed, 4 Oct 2023 05:36:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFo/dlUUqbIngAVvrTcAObXxgHp6MW3ja+ipTkfFWk1VhiYl8HjBDVjQzSWF/bIdAwRONZE X-Received: by 2002:a05:6a00:39a2:b0:691:2d4:23b2 with SMTP id fi34-20020a056a0039a200b0069102d423b2mr2538125pfb.15.1696423000651; Wed, 04 Oct 2023 05:36:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696423000; cv=none; d=google.com; s=arc-20160816; b=IxBj7bKhnhxFi4zNus+OWwqD6labkaWfj6SUeSRUhy6RIJH06D3nL3wM50nUDbssxF Xg0nfCPaYzzivNfx5FTVLVUCpFmjVrDYIWUa+8hBhdilS0KuCkNCsSkN6sz0KGlCzCsr OrSIhWP7UDRdw3S9jr5OnISfS/TX/4CRtZJ8knEqPANme582woknKkGAtMsaep5/JIp1 iOioM+SnShGhjWlhaqVwFI0MrYY+4hDwpZqvilGhWNbbDONETQkoF1BwQouw8x0pGqft Z84BMdpztK3NHUCDV1KwaLNRFIfmTfGM9bYU0vJr5FGHNmc+agb41+WJfEt8MVbnRoj2 V56g== 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=pz8RP5Igf6Tpz8GzWwXPtm9q6OrinBuBcc/7z4I5pxE=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=SYB2XDJFne/B6SRLjOGbtU/v7SWpd+1QwH+NqffXxoac4FIIn7Ezzvyo+Td/XX4CGr LyQ5elC2w5smKrroCFvk6ZndNEf+HZeYcmoIayFXdn1Qv/cAuMOMfHMyughXN2NR8lAn pqwHfSDv7JGNydEkc5UwZ+m1IBO+nWGpCkCshaBTSK9HAtzs+OpF/meuhtniZWJcpSfX 9rC+mdb+ABYThctLgaTQCduuxEVp5IGWxhaHhtQdCqvtsSnMO0gByI4xSs0Dniwikh5N laVFwzcm3s8jIsNXe3HOzzlcvIS1r1jVgrb/nX8ti5nXcfLVMdaH4LbSXWlc0+O/UaPT xNbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BOmtu4iv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=V2dSsPDW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id fj22-20020a056a003a1600b0069026a3de0asi3800189pfb.138.2023.10.04.05.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:36:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BOmtu4iv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=V2dSsPDW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id D4E2C8348D84; Wed, 4 Oct 2023 05:36:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242445AbjJDMgK (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Wed, 4 Oct 2023 05:35:35 -0700 (PDT) From: Anna-Maria Behnsen <anna-maria@linutronix.de> 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 <peterz@infradead.org>, John Stultz <jstultz@google.com>, Thomas Gleixner <tglx@linutronix.de>, Eric Dumazet <edumazet@google.com>, "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>, Arjan van de Ven <arjan@infradead.org>, "Paul E . McKenney" <paulmck@kernel.org>, Frederic Weisbecker <frederic@kernel.org>, Rik van Riel <riel@surriel.com>, Steven Rostedt <rostedt@goodmis.org>, Sebastian Siewior <bigeasy@linutronix.de>, Giovanni Gherdovich <ggherdovich@suse.cz>, Lukasz Luba <lukasz.luba@arm.com>, "Gautham R . Shenoy" <gautham.shenoy@amd.com>, Srinivas Pandruvada <srinivas.pandruvada@intel.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Anna-Maria Behnsen <anna-maria@linutronix.de> 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: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 05:36:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778828444582710248 X-GMAIL-MSGID: 1778828444582710248 |
Series |
timer: Move from a push remote at enqueue to a pull at expiry model
|
|
Commit Message
Anna-Maria Behnsen
Oct. 4, 2023, 12:34 p.m. UTC
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 <anna-maria@linutronix.de> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> --- 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 expires) return DIV_ROUND_UP_ULL(nextevt, TICK_NSEC) * TICK_NSEC; } +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; - if (base->next_expiry_recalc) - next_expiry_recalc(base); - nextevt = base->next_expiry; + nextevt = next_timer_interrupt(base); if (base->timers_pending) { /* If we missed a tick already, force 0 delta */