Message ID | 20231004123454.15691-8-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 hf10csp98464vqb; Wed, 4 Oct 2023 05:36:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGaJDcMbs9YnzFDP41yM6eEm1HwvAB9EtGpeY9ymfaPU0T1+VYxVw+SXqnH5Au/N4QuvRWb X-Received: by 2002:a17:90a:e144:b0:26b:3751:652a with SMTP id ez4-20020a17090ae14400b0026b3751652amr2085766pjb.38.1696422991979; Wed, 04 Oct 2023 05:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696422991; cv=none; d=google.com; s=arc-20160816; b=DVQnabYlYVNtJSw/L5f4I4JzsXRJyabxCmqAfyPTrwIRbrQZe4XSQTwjYHBGtL3eVX enht7GU6YGOp3/DgY/XRu4tSLIvWNrj6gRdUpesf/EUE9hsPEakUXi9LZocfmQPd6Fej kvdQP/LD2kB+Y9Gd6umBJSgFFvfdvb42AO+G6yhlZiRSX2OabtJ15349grXkbWZYRPYn bWatLVK2oMJNao/GXqycdmK8DllpEzAYoa6SZGwVbuRGTE2j5UMBL4jOhs87gME9TABp 5SIfMZj7aDeYYuCt8zsZX/OUavqcWz75ri4IV84+Y778KIOJzH0BRlOlessheLviMtBs spbw== 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=TACaL1lFRKPWpkhfzVfD3M8bG5zQsJmcuSPp/gOAMUM=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=aU6hnUAea/P/bDMx5IOdLGqNdzudYbh4J+nf6iRIQOWhqTk8yelEZnceb1d16S8BSy b5tQXOCwj+CvoC5jvvVS2s4N/y55UVSPXq7DeWQBiKjfWamSNIQJ1Ch2ReuEsYiWCfly sj6u7m/XUhBO0Kjedt8MNilXHyxfYbc4Qkh7tms6+khM0YpU/NNs2dJi0q4flQeDEqm1 FauM1GGtQpGkhavvoXYNJtPdR3/n5dKXCCESHrjtNHc17waNgiwFhhoeD37BaraV9A7w RYNuVvlyY93h7hY6ZovILSFLbRIhJmt5z3p2eGfVykEVJ0AFih3Il0XPQrMKGY/TY5VH eKhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LW5O10L3; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="f/cvwydX"; 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 ms21-20020a17090b235500b0025bb4a1c12esi1377361pjb.148.2023.10.04.05.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:36:31 -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=LW5O10L3; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="f/cvwydX"; 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 346EC802D42B; Wed, 4 Oct 2023 05:35:59 -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 S242409AbjJDMfu (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Wed, 4 Oct 2023 08:35:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242369AbjJDMfe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Oct 2023 08:35:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49125BF for <linux-kernel@vger.kernel.org>; Wed, 4 Oct 2023 05:35:31 -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=1696422929; 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=TACaL1lFRKPWpkhfzVfD3M8bG5zQsJmcuSPp/gOAMUM=; b=LW5O10L3K/13uU8Y/WizuaxwUjNbbEFTne4OjEEzLrAOTlX0f5E1sU9zYiEDesd9RStzju rcdIC9V+wKtNSFXHSiKXzApMmy4s0mz3BSHlJCEF7yyClrGObOgR5wRIDVVRu29cA9OGER 4bZaDCZgHutQ6vKti5lxrmQJPtJVHx/sA1V5jaPVPU+ruJsQrsjZrkobBWNVIRHbkaP+ba vo3F2FnwjvkuFSxEkxrSg7lhbUkKBGNh0rjeyRE3E9+EvEnXoqMmLIHQA7CoM4scSouyM7 57E4l5kJU7wTMQdxf6lZwGRmH2tQ57seDXgvk/DIueRaDeJBCZD3N0TfKoEhDg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696422929; 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=TACaL1lFRKPWpkhfzVfD3M8bG5zQsJmcuSPp/gOAMUM=; b=f/cvwydXPVYbloV/MLHuClxhZ4pur5aHlYO74vCB/JxgoWTJfTrH14sdSnUTBJu/CdxMxy AqNgfFlMXVer0rAw== 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 07/25] timers: Use already existing function for forwarding timer base Date: Wed, 4 Oct 2023 14:34:36 +0200 Message-Id: <20231004123454.15691-8-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:35:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778828435359186021 X-GMAIL-MSGID: 1778828435359186021 |
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
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.
To avoid code duplication, replace implementation for forwarding timer base
with the direct call to the already existing function.
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
---
kernel/time/timer.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
Comments
On Wed, Oct 04, 2023 at 02:34:36PM +0200, Anna-Maria Behnsen wrote: > 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. > > To avoid code duplication, replace implementation for forwarding timer base > with the direct call to the already existing function. > > Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Good catch! Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 2f6afd1da891..dc58c479d35a 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;