Message ID | 20231201092654.34614-30-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 r17csp992264vqy; Fri, 1 Dec 2023 01:29:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOg1iyzzjRzIU0k22qG0Mo4gWudieXj0vmOWC7QeKzBXy16sp62Bivz2gOmdyFbNfwKjT7 X-Received: by 2002:a05:6a00:130f:b0:6cb:4d36:6f9c with SMTP id j15-20020a056a00130f00b006cb4d366f9cmr23934915pfu.11.1701422958877; Fri, 01 Dec 2023 01:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701422958; cv=none; d=google.com; s=arc-20160816; b=kUMCM6gqQOH/GHatWfBzNoGpXBbffUx7B4xh0IwE+eK/Mz0Icomz/r/C52S2+CH9dQ CSU2GkP005R3sIWEeC6w1mZaV26s1/0q83Gukk93bBnfpVw/vzVQd5VEss2BKITaY/DN nflpWKPRO4LreFXmXxC22wrM0tPxCWdTlI7ZwnENWPamaTr3sRtg12TLBlglQc0ofrXq qFWiZFoh/1DQTz++IKBB0szXvDhJw6CZzDIPFPV0MUs1wvyoazuV+72UIw7eXhuhAd8r Zau3J59wbrk1mVrpI7hl1/aIcDVSfIWIfgxQyMfLshw9AhxMTLP8HwodH90VAMTBqUeG VLCA== 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=Lz8mvggzvpUJEzbVXb4zUQlWwIeSFK/TCyXr++4TCPE=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=rC/ZFfTjLU3xSre5KLNrguspizm1Ja/hHqiKKQ0FuVJrE7Hqc/rvfiWl9LQINAbxNl L8oFuD4/I19K6VvRII3lIAyncuWwtRXuvyEj55WZKwWEScYVX538TsaxuMVhHxxJ/deM BUWd8eHt83MEGgkGBOZCeClWqo6a17L1UHqHZshkBJfpzcKI/ZPg5Td5G7XV6fafb5AO GcpAARBikfd/Pk3Kz6s6n/rqrQP4NeOIYNjBqfDGCC/cgo3WA3ky9s6+7vlPQusAnDJi BzziyZ3OmK8n1mqMPDcHcprlH6hoPexoAh7dFdrLm3k25sjsp7Sl7zVbqOiGUsRRYw6d Yj3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EdTH1vhM; dkim=neutral (no key) header.i=@linutronix.de header.b=7AWmEIid; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b12-20020a056a000ccc00b006cd82b4d0c4si3116736pfv.89.2023.12.01.01.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:29:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EdTH1vhM; dkim=neutral (no key) header.i=@linutronix.de header.b=7AWmEIid; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 8D1F280FA9CC; Fri, 1 Dec 2023 01:29:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378194AbjLAJ27 (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Fri, 1 Dec 2023 04:28:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378081AbjLAJ2M (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 1 Dec 2023 04:28:12 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FB571FCB for <linux-kernel@vger.kernel.org>; Fri, 1 Dec 2023 01:27:28 -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=1701422846; 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=Lz8mvggzvpUJEzbVXb4zUQlWwIeSFK/TCyXr++4TCPE=; b=EdTH1vhM3NGV6kmiUinGxLJ1Pm0M49zT313ppufUyWkX5Xlv7reO3Fk/sLVkQhQK7lDkKO OKyWIf49mKkvRSRvEz9LZ5jjWbVDcj8jaEtC5xYrxylR/wiK7coOeLfGlMNmNN21nXNxHf sLA55soY106JsKuC2y5XYkXpChswmiJF6O35gv4lDjmZE9ckO49OZq9IJPQgcUO9H2pjss N8ZOv+qp88KBvyM5BxqOCJu8mB64sQctsoqxBAJ1AjggNxBxfqRnfryYYOwsaBJgc3yW80 DJAqa12Niwukm8v9KHr9jy9njV6OEiO4TlibrrJzd9x+L3mFmztY9Gk/tbWvqg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422846; 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=Lz8mvggzvpUJEzbVXb4zUQlWwIeSFK/TCyXr++4TCPE=; b=7AWmEIidBRmfR/ZiDTR0IYKQlxe2r1jHuUlbpKg2IhmL9oFRBHb5oBeNAoamIAoHtCdXMK z8HthAkNaKBDp5Dg== 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 29/32] timers: Introduce function to check timer base is_idle flag Date: Fri, 1 Dec 2023 10:26:51 +0100 Message-Id: <20231201092654.34614-30-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:29:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784071280638137258 X-GMAIL-MSGID: 1784071280638137258 |
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
To prepare for the conversion of the NOHZ timer placement to a pull at
expiry time model it's required to have a function that returns the value
of the is_idle flag of the timer base to keep the hierarchy states during
online in sync with timer base state.
No functional change.
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
---
v9: new in v9
---
kernel/time/tick-internal.h | 1 +
kernel/time/timer.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index e0e58dd18919..2d1a44850c20 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h @@ -166,6 +166,7 @@ extern void fetch_next_timer_interrupt_remote(unsigned long basej, u64 basem, unsigned int cpu); extern void timer_lock_remote_bases(unsigned int cpu); extern void timer_unlock_remote_bases(unsigned int cpu); +extern bool timer_base_is_idle(void); # endif #else /* CONFIG_NO_HZ_COMMON */ static inline void timers_update_nohz(void) { } diff --git a/kernel/time/timer.c b/kernel/time/timer.c index a797603dfd49..b6c9ac0c3712 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2201,6 +2201,16 @@ u64 timer_base_try_to_set_idle(unsigned long basej, u64 basem, bool *idle) return __get_next_timer_interrupt(basej, basem, idle); } +/** + * timer_base_is_idle() - Return whether timer base is set idle + * + * Returns value of local timer base is_idle value. + */ +bool timer_base_is_idle(void) +{ + return __this_cpu_read(timer_bases[BASE_LOCAL].is_idle); +} + /** * timer_clear_idle - Clear the idle state of the timer base *