From patchwork Thu Feb 22 17:12:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 204891 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp88794dyb; Thu, 22 Feb 2024 09:23:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUFRbMPQj2MvW3iIZOPHIBKcTQFrzDkn+jG6JbbJeAQ7qBTE1aS821FDjTqAJwHfubrVFV9lSxDuRAJFWLmjer/y2u+lw== X-Google-Smtp-Source: AGHT+IGu5hsAxbvxzThIwcKh5/lV9WZKICTJ8RBWb3ZWsHDIVQFVXIJKOn1zWParGARfSJehmmzC X-Received: by 2002:a17:906:e208:b0:a3f:161e:98e with SMTP id gf8-20020a170906e20800b00a3f161e098emr5381254ejb.50.1708622617166; Thu, 22 Feb 2024 09:23:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708622617; cv=pass; d=google.com; s=arc-20160816; b=HZJIDz5KjYKlIH6ZrqhFsgQw/U6x8osrHGxH90hpXvPeDfDJbgwGeP5Ar0vjO0ZHv8 egAi5+ysXjx+ivgsrAyN9h4H4OKBWnCB6o0kz6gavoZZFfxTF9hiiA6qd/fPl7PAKh2E nialWBvQtIjArDhKdobM7qoNzr2YGdabjlS/USs5+bl7Y9zbyRw2bePOsE3S773l92aT pheF9YMIJ/W76+leGWtwkW466ufCWeDfFy9qo1Esz1y7/KLXAm1bi9IN/ClWca63QrTm MraINo6sjHwFl1C1Ap7k8YpmlsoEctifZew1EKPMrhnKjJRv2kczExmAMqfwR/PYkrqK sydg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=/16MK3Otxhbv+zGW2DDiw4HNmylrodOU+Dw2SRu+8MA=; fh=IdquJyaazQ3wXWxdOExnpctJRLX4Jw3HEb/tnyKonzY=; b=ya6gNMh9aiRJ6WP4AhZdkaojqvQS7JwQK1pxai2ZgtxO+EfySiscubLPzN+7fvmW9c gJ0GMKaB3t4jef5QfXVCQWOUCPgxpuGse2qy+4ghxIj2FyBDMRKPBkxChFGZkRckWJDi tB0oQeP9svOS0qtaTCeJ30B3IhWZsZmeeJ0EoiJBFzIC161FIu76r7r+P9afbZIhqurW W53V8QkR/9T3HD5bed1D8bzVtyOd0XTNTvOnlXc8vRlLYxvjePKjVpfHmsB4LZ/UGWJ+ 95y5htgH0SZXONMXreP5s0H+OIZ7j6AwGctvJCxUnAZjN1IOPa2diOxLgm3B/t+9ZFqL Zthg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CKMJYy6Q; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2ruP0wCQ; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-76934-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76934-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lt13-20020a170906fa8d00b00a3e788d25f5si4201829ejb.188.2024.02.22.09.23.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:23:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76934-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CKMJYy6Q; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2ruP0wCQ; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-76934-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76934-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1BAD21F2918B for ; Thu, 22 Feb 2024 17:12:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE7DE156993; Thu, 22 Feb 2024 17:12:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CKMJYy6Q"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2ruP0wCQ" 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 142A414C5AB; Thu, 22 Feb 2024 17:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708621930; cv=none; b=iKTnZrVJRvQNo/btt/zLz3v38Sc9vEXBYhWG06m/10fzG15vnUghZ6cljjPNPCYwKIb4WJxW078/+niXfsbbMMqsUKU4BoOakJa/vYGQEHHDD5uElMbfa2bcECF8pA5b3QyUGMqXcxjTeQ8jiQbShdogr5LiG5Eg3QVK126/KZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708621930; c=relaxed/simple; bh=YZm/XgM0xRkKyAGqQ/2cFME7qeJi2s+j33grqYT8TQ8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=j9gjjDaOzoaKO831MhcBf3YBx2DZwau/3hu9wc6r0FoXCrF0DSNsm/jhN1FHNTLXE7ohzoVKBbKDkejQrMQimBoYGU8Z6mFNbX2MPF7yNHGVAhhFUppoGWVrJMLru0hreQ9bVGBuKbhLpebS6Q1UOeE1Zjfee2B+tdfHYZOUnfg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=CKMJYy6Q; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2ruP0wCQ; arc=none smtp.client-ip=193.142.43.55 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 Date: Thu, 22 Feb 2024 17:12:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708621927; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/16MK3Otxhbv+zGW2DDiw4HNmylrodOU+Dw2SRu+8MA=; b=CKMJYy6QWuA58UW2224k5s/9DytIOYgMzH6+M8ZG2ArXs5CDpiWOyESm0WHyIm1PcHS8CF C80/SK3f8KP/8KRS5hUv938VxKRdCG0fX6bKtnQmwilcaYEn5IFkndTEns1hhAYHhPkUOL d+GvP4ZKkWOfhYM4JN8VbJ/BuLKMq9/63HoGeXI+nokJA32CrbdP8HzGOQZfx/8XVSacru VCq6ezsvd5DdyZBLfOJz95mgMf6mNfX+O+Q3Qsqx5hPEeamMkXW+7mB+VRo3us4eVOTYPD DRSKL0sYPONyr9Mpj/WfErkWqXzuJglU9Ol/YyOc6AaUZ+MxR4JBxZAM5IJ7SA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708621927; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/16MK3Otxhbv+zGW2DDiw4HNmylrodOU+Dw2SRu+8MA=; b=2ruP0wCQ9gNTa8owTjXrrs6B38XwxpdhpCRLE/RcMuysnDPmwMoe6bF7eWw6DPK+I/X7ds o0pNyhdwNwS5f8Bw== From: "tip-bot2 for Anna-Maria Behnsen" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] timers: Introduce function to check timer base is_idle flag Cc: "Anna-Maria Behnsen" , Thomas Gleixner , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240221090548.36600-18-anna-maria@linutronix.de> References: <20240221090548.36600-18-anna-maria@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170862192671.398.14655637018769907129.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791499081751944992 X-GMAIL-MSGID: 1791620669602532224 The following commit has been merged into the timers/core branch of tip: Commit-ID: 57e95a5c4117dc6a67dc416d82079c02dab7e983 Gitweb: https://git.kernel.org/tip/57e95a5c4117dc6a67dc416d82079c02dab7e983 Author: Anna-Maria Behnsen AuthorDate: Wed, 21 Feb 2024 10:05:45 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 22 Feb 2024 17:52:32 +01:00 timers: Introduce function to check timer base is_idle flag 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 Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20240221090548.36600-18-anna-maria@linutronix.de --- 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 ccf39be..7e30901 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h @@ -165,6 +165,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 4420cdf..e02ac46 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2159,6 +2159,16 @@ void timer_lock_remote_bases(unsigned int cpu) raw_spin_lock(&base_local->lock); raw_spin_lock_nested(&base_global->lock, SINGLE_DEPTH_NESTING); } + +/** + * 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); +} # endif /* CONFIG_SMP */ static inline u64 __get_next_timer_interrupt(unsigned long basej, u64 basem,