From patchwork Mon Jan 15 14:37:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 188179 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1742778dyc; Mon, 15 Jan 2024 06:38:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIKJG39DIJPda29Kn6o3KM6rCIT5Jhh9ViZx6Aa8XmlXrUHbdOifgAufmsksYcmN3neyLQ X-Received: by 2002:a05:620a:a95:b0:783:539a:f30e with SMTP id v21-20020a05620a0a9500b00783539af30emr3970919qkg.83.1705329524476; Mon, 15 Jan 2024 06:38:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705329524; cv=none; d=google.com; s=arc-20160816; b=NHmHVtnwDkkpQc1mZt8mS5AlF2LEoqZ857atIFkxBdXfXK0NIgkyeApPNCRwLp/49x zYGgpTE4xrPZQ7hwoYslltuzlI24ahJwx3B6sib7RfKTkmBGKElK1V8bMSUT1zmQHKd/ vNWV5/zbVK6vJpPqNrZB8nodO8N+3Fy/8ehL3Y1lUmyro7ra4MaYJi95O1riA53g+ZsA cYj0+npaYTNxkT5tJQP27UUeDw4GIWWVNnvwcKTLvOXzFCyHNB5Acq086Es/Rc6iiKk9 6C89cL1yEjx/yWQ+RQLMiEolGz3IDCzKK/FbdEKNLJOo/uAu3MhflEWvorPNGpTilakH Wm6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=MI9g9MDbA2NFp7jgDttymOb2sC6nFxhp2a/RZS0Cubo=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=itdn2L5Hvy3e95axhRwwGfM0f2UgK8KFpuHKdc3QcmO7j0bZS3XrFTDLQOirydrAc6 iczp6VxQbrK5GT4GdBX1yc4NXzBjFqbQmEIGiGer5W3L6zpUp5Lsg/izviaxkyZ1AWq+ VLALHX9UdIqOWZNlT4OEhDC0OQoRXD2VtWLaC1q439iIBV3m2Ch3byOgEz9iCP4Wuo0Z f5ra2akmi7jAv99d3oHf47eS7/fIx9O92eU0tJlQ3Rsmb4w0LfEE11bJzdbSrWrdk2dQ DcNcwDOIqMPhEK3XX7KY6Fly7DcQuWL9mjFunjlDEW7/IcfKYc5MGdFtYrL05aaa4VUu 16Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dKME5u9Y; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-26096-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26096-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g18-20020a05620a40d200b00783420fb6f3si8582469qko.314.2024.01.15.06.38.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 06:38:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26096-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dKME5u9Y; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-26096-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26096-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0178F1C21B61 for ; Mon, 15 Jan 2024 14:38:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2BB317BA5; Mon, 15 Jan 2024 14:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dKME5u9Y"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BZs3wXhs" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D62DD17738 for ; Mon, 15 Jan 2024 14:38:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1705329482; 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=MI9g9MDbA2NFp7jgDttymOb2sC6nFxhp2a/RZS0Cubo=; b=dKME5u9YJRG9rJBXAK+YQgOciaQpeurM1q2gGo7H/jfxRnKrlC/PnxxVZXurGGwTY+rmXc Ldmk2exeCLEOEpJhE3PzGps785U+vNDBLqTn/GQfF9YZnpR4Do53XoTrYwb6bwo31kTeQq h5Qe4It9XifK89MSwYxtYcSB9Nzs91HFVu99rFZ/9GwT3OAZ4vD+fCvCr/ZJnam3Bv8wIc Gk+QuEUicMziS1+XSLjIyuAyU3+vIOjzIEnA5A01l4IoBk1rbkhl2sfMlrJnmB4Qpqgjgy +b1bwYF0jt3dKgrbnyUkhtZei+IqjaSTu/NHB2mzluaCybNsFaJTg6xgV+AxnQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1705329482; 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=MI9g9MDbA2NFp7jgDttymOb2sC6nFxhp2a/RZS0Cubo=; b=BZs3wXhsMMmkrUob5t5tgA7S+fbdHDyNyUea31/wUAg5nASEUBX78LfwVe21ZJgJzXKJGw ftF9HXeATwEkVvCQ== 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 v10 01/20] timers: Restructure get_next_timer_interrupt() Date: Mon, 15 Jan 2024 15:37:24 +0100 Message-Id: <20240115143743.27827-2-anna-maria@linutronix.de> In-Reply-To: <20240115143743.27827-1-anna-maria@linutronix.de> References: <20240115143743.27827-1-anna-maria@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788167611546109073 X-GMAIL-MSGID: 1788167611546109073 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 Reviewed-by: Frederic Weisbecker --- 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 352b161113cd..5f21db4fa3ca 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1937,12 +1937,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; @@ -1960,6 +1954,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. *