Message ID | 20231201092654.34614-15-anna-maria@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp991841vqy; Fri, 1 Dec 2023 01:28:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHm5E97/IiXE9lAj1KOAhTxbCUj15qlXLOdohwG3/C3qRaCEtTN/3H6nZvsxtksoxRVGTVg X-Received: by 2002:a9d:6743:0:b0:6d8:543b:6cd with SMTP id w3-20020a9d6743000000b006d8543b06cdmr2303275otm.31.1701422894644; Fri, 01 Dec 2023 01:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701422894; cv=none; d=google.com; s=arc-20160816; b=lMM6yGA+AXlYHjbfuKicbHPH1zq79dmbm//58u801FehQeHDg08KIFzHyL7Ri8NYPm Evhadik36OrAWYMXifaLgRt/KgOyBZuVtciBZ5Dpcx9KM1WY2JqwHiJVXmLBUGxIS2kq FC2+qDaBhRcXC/+OpFpQld6flvHzEwTOmInkO3foDo0ROFjcBE0yEqzxCyds9TEbI2de 7rr2hTk29jzp0q/9Edgvh8qWudmQRMKFWLDGM7G24zQFBkY9x7tTpK9fhKlRzqqj2u44 D/QuEnLkdQ+HgQYHRqU2oaNftfANGTbdtzidndH5+6TiM6UtvxC4KOPQar1qNxGnIlII GxXA== 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=JrX+uOonkdlgOULBTRJ+tPCkJgZ/y8AeNa7bH45nGMA=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=bo5D0MbWy0Nfdl6h417lgnqng/w2JHeafogoaduCy/5KmLP4jZ7fIwNterKtUlaQ8h HcA/h6g2bQCWbmWiMsYzz5kr8zJgitOWj4teE3PiNqJAdeC8dH2fSPgFo7Q2Q6xZzPtW P85MdSFFKJa4m4iVx+ktRWmfLXEYOeYKdCUvI+IZ7xBrXFYVgE7NANqCilclYtUP0OM5 FsohH75ocTXbvhhbk6nxtWkLjRMGA5QCgqI7XKVkxFz9DK5NyFLHvx5rAkqle67P5yqk LTpbRbTm5TpmltINYAezPqVnsLUniDph3UryJ5sOl28JxcCVwiy2Fjox7+hgB7FGjJ9c r3Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D5XrFnLB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Mla+Aech; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id m189-20020a6326c6000000b005bdbda280c2si3077787pgm.364.2023.12.01.01.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:28:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D5XrFnLB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Mla+Aech; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 4873181552EE; Fri, 1 Dec 2023 01:28:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378134AbjLAJ1t (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Fri, 1 Dec 2023 04:27:49 -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 S1378030AbjLAJ1W (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 1 Dec 2023 04:27:22 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44E0F1731 for <linux-kernel@vger.kernel.org>; Fri, 1 Dec 2023 01:27:17 -0800 (PST) From: Anna-Maria Behnsen <anna-maria@linutronix.de> 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=JrX+uOonkdlgOULBTRJ+tPCkJgZ/y8AeNa7bH45nGMA=; b=D5XrFnLBsbY5lkVSgkpnNLWdRfAh8BRN6Ig8U6EK79iQ7Zz6/XWyZ79d2M5HXR5I74m+Pg S2hARumZwAdv8qw3krKtquSgSCKHqHiLz+BWE4T0RiujFRl5MC0AqCSeVPs3cVP7Qy8QTt BhTFkQaRlJPXDnkOTYvZAkLppDQPesiYyCwodQABI0CGKBDr6ryeU3PvmE3eKTtphN6BN5 vZ6ZXUk6bXGQAKaLiOeCpTyaEQEBor8J2m5oteVUECBzkbP15etoSFY8qeoidjKwOILaA6 vmJKuQ90tjl4f8jjJJDBqc7RPGnDbvC09YC3jWkqB+JV1J73vhnXmj6HVmW2MQ== 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=JrX+uOonkdlgOULBTRJ+tPCkJgZ/y8AeNa7bH45nGMA=; b=Mla+AechBwy5Fc5CLuvFJk+kdfUcABs97vqRw9ixz3j4sPEqx0f9eeiOBVWA3gXcymuY6G 1eT8gT1dpYXIoHCA== 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 v9 14/32] timers: Split out get next timer interrupt Date: Fri, 1 Dec 2023 10:26:36 +0100 Message-Id: <20231201092654.34614-15-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 Content-Transfer-Encoding: 8bit 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 lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:28:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784071213263580529 X-GMAIL-MSGID: 1784071213263580529 |
Series |
timers: Move from a push remote at enqueue to a pull at expiry model
|
|
Commit Message
Anna-Maria Behnsen
Dec. 1, 2023, 9:26 a.m. UTC
Split out get_next_timer_interrupt() to be able to extend it and make it
reusable for other call sites.
No functional change.
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
---
v9: Move whole get_next_timer_interrupt() into a separate function instead
of splitting the bits and pieces.
---
kernel/time/timer.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 9d377ebb7395..c9f7f86e95fd 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1911,15 +1911,7 @@ static u64 cmp_next_hrtimer_event(u64 basem, u64 expires) return DIV_ROUND_UP_ULL(nextevt, TICK_NSEC) * TICK_NSEC; } -/** - * get_next_timer_interrupt - return the time (clock mono) of the next timer - * @basej: base time jiffies - * @basem: base time clock monotonic - * - * Returns the tick aligned clock monotonic time of the next pending - * timer or KTIME_MAX if no timer is pending. - */ -u64 get_next_timer_interrupt(unsigned long basej, u64 basem) +static inline u64 __get_next_timer_interrupt(unsigned long basej, u64 basem) { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); unsigned long nextevt = basej + NEXT_TIMER_MAX_DELTA; @@ -1975,6 +1967,19 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) return cmp_next_hrtimer_event(basem, expires); } +/** + * get_next_timer_interrupt() - return the time (clock mono) of the next timer + * @basej: base time jiffies + * @basem: base time clock monotonic + * + * Returns the tick aligned clock monotonic time of the next pending + * timer or KTIME_MAX if no timer is pending. + */ +u64 get_next_timer_interrupt(unsigned long basej, u64 basem) +{ + return __get_next_timer_interrupt(basej, basem); +} + /** * timer_clear_idle - Clear the idle state of the timer base *