Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp478941rdb; Thu, 22 Feb 2024 09:21:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW0qpqlIuU6lpYVFbKCHTbuGY70PBOWbt558r7o+MR5tfenbeS4Pac1h2N4ET63O2LwbAMKyBk+N6FvjEsaqKwtcOnxj0peV+/edp3ueA== X-Google-Smtp-Source: AGHT+IGoBLqF0dF7QUTGJf6gfJoAIKLTOHUJf6+KWQ+jneB1sBtzQrFl5oNsXiaBdCsSOF2eIbx9 X-Received: by 2002:aa7:dd0c:0:b0:564:aa84:caad with SMTP id i12-20020aa7dd0c000000b00564aa84caadmr7568385edv.0.1708622515033; Thu, 22 Feb 2024 09:21:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708622515; cv=pass; d=google.com; s=arc-20160816; b=hmf+E0sGuiyjPvlPboMtWeVuLhocDuUyqktlws63Cn0in0uqXLDAHZuRNURga+g5eh cawk2hzLDJ0rv72bdGv+P3hQnJfOhUWqubxCprenkEQezZHiXYdd9CIr7ognjcoV8/RF 41y7+kpi4j43U2zIS2mpm79mZHbhYFKd1f5eW5TsrOwbMpkpgSPe54asL0FdoRTMlv8X pzG4moprmnfPlLsSXTsJtc5Upi/2eZlremYrf5cUlEfRmik34Y6bwpS9iOCapLrzTpnb htDOuDoF0/4Ljxpa4TitkJ9fiBpLMnyuBAQn4NvfRpoxxcAynKXoIu8nP4aKmQXd/kxp pcVg== 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; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76934-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dk2-20020a0564021d8200b0056431ea7a8esi5014944edb.550.2024.02.22.09.21.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:21:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76934-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76934-linux.lists.archive=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 879571F221A4 for ; Thu, 22 Feb 2024 17:12:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73CBD155A25; Thu, 22 Feb 2024 17:12:11 +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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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,