Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1582894rbb; Mon, 26 Feb 2024 14:24:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXjoXD99rGKn0NcAxDo4K9QvSJwDl9MZxL1DpoDunnBDiHLjlDtZwP99UkqI0RPGOx/3ZWmHDRFJLLB3LKyOsR67bspJw40QSFAKuzlUg== X-Google-Smtp-Source: AGHT+IHCJIwRodb1rjTOAMq6Nf6WSW2hddvnqPPdL+VFLY0hh7bTghGHqKojdoy/UIEgqbM2URKy X-Received: by 2002:a05:620a:2a13:b0:787:b0b6:d836 with SMTP id o19-20020a05620a2a1300b00787b0b6d836mr519765qkp.63.1708986277854; Mon, 26 Feb 2024 14:24:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708986277; cv=pass; d=google.com; s=arc-20160816; b=qVoMxHm0u0Or9PlGA2gYE2ymt6Du7hAwEJGKJi0T/tY6H9gTQLBY4NftXUVNj8jzWD imy7FKbHfDHvB+7W24nlLUAbSXRkR/mD/gaZp1IuV3HCt+o24GDRI0l30mcxjKFYa+lX jSatwBy1P45teNuLrN4xzkmG+pN1qE8pxOy0uBSdwwLy9ayNPXz6uxUrWHbD6ETkdjWx izQ3Rry1pbbK6TpupCMX/wEATn2IZkc6N/8B34pjgQjip7MDBPjIElhd9HLK3MXlxA2l 4fZLm7+yuTypCxR6kR820OIlxQJpG5V5ZTVgzdXnv3OHMNkWuKK8rICmDOjxQftPdDDq WgQg== 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=MVzKVsJhf5e6bXf2ZcV/iev7ofEWrTQXAf+4O63SiZI=; fh=9Ax9dUTktkw7GUAcxhp/hScrn1H6VeDItxi6qdujZxg=; b=Ehz3Q6k4v/2g2VMMshCQrFaeMWYeaelEKrOFFjwpA4i2jrrCtZvujCuM10731S5pAr no+B7M7mbGuTOuCf7N7TdMtsZ+GmPOov4UZMc311LiScyQezR8y9YGYJGuBd5o3IKhAn AKplomlEGslieCFidiliMIHnltgnkR18WCweika7imfG2EdAQxcyma2OqDBOrcAcNqBl LCJTaTUmRTfNbbhz9z6FQa7sPuXealKX9PwLgaEpwpXfLsI97ud8jPpNXvBw34J/+cyl T56JZCGnvtyxXq3Vv0K2B66TyaLahtTdzSROAna18kjQSw8kBFBCqIh47XwEBaRKnzVl Fsfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Y/zKEXIK"; 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-82385-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82385-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wk19-20020a05620a579300b0078734fe5612si6039450qkn.656.2024.02.26.14.24.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 14:24:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82385-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Y/zKEXIK"; 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-82385-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82385-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9A4561C23235 for ; Mon, 26 Feb 2024 22:24:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0EB2132C06; Mon, 26 Feb 2024 22:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Y/zKEXIK"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WH9DlPoT" 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 2C4A3132486; Mon, 26 Feb 2024 22:24:29 +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=1708986271; cv=none; b=KyFMbHhRQ7OMzu18nxL5k9ex+k+8XKK7odtCuXH4oTRiqgNls7BCR8njUiVCL4YVFM/lnKGEQJcyO20A3Fb+fvNrU1usriQCkqqDUhmfFXZYyTG/XqA5vboWW3sC6U0rMSEa1/EjlxI/JPONVgOVlgQvZdGhqw7cp6AtXHlBn9o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708986271; c=relaxed/simple; bh=TTrlwk/E8iegOt2UjKcQXtlNzMYojq0/n1Iyl0jVdCA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=ZhmKjEZpM5CrXXwvJryx4obiZwBEv4pL6rsAjxP3MOVjrthgqNdaHlzJWGV94oO8eKBD4lG1tuUX9kFNO0tA1rIWBcLv8HOCD5XlHYoHcrBFkRHWlhO8eolQ1IT528RiZGkDZt5Zc4sxzuPrDcJQH0HNgRni4PnRU61SIIZ/Z24= 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=Y/zKEXIK; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WH9DlPoT; 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: Mon, 26 Feb 2024 22:24:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708986268; 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=MVzKVsJhf5e6bXf2ZcV/iev7ofEWrTQXAf+4O63SiZI=; b=Y/zKEXIKagayaKzokOU4zQBlM52gZJ5Y2RXG0HqQ6N70NfgRy6Nfq3wwCpMwWgFj+pY85a AWi29vbZpskrMCN2HNLOBPDCgpePTEKuQjDZx0ef7MSRSwhWco2RDA0mrqHsxp3iJhRlj4 kbKf18NcvO/qZkCnAXx0umqUqzJSN2FF+PgpCP5Re3ULDQsjm7fuTPDsbzdbE7E7Vnrb1R fF29KefOb62gDyc+JiRXibAi+Adbk9MNdeNUQLoEVAv59w2su8/NN8ykRwz2p4bN7S/uBw TMM7vUeqPTfO0+WfaqSaiO0prd7fucCm1D/Lz6otGYuGwJHtMfQboELWg1KRNA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708986268; 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=MVzKVsJhf5e6bXf2ZcV/iev7ofEWrTQXAf+4O63SiZI=; b=WH9DlPoT+ufFKFGbncdWJSzJabGFVZ84DZGz0MqxZUafPbvZr2Mah5h1/prR6mY3r2p2tr LP5TpFkWSkll5HAA== From: "tip-bot2 for Frederic Weisbecker" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] timers: Assert no next dyntick timer look-up while CPU is offline Cc: Frederic Weisbecker , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240225225508.11587-17-frederic@kernel.org> References: <20240225225508.11587-17-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170898626753.398.4108841734022309650.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: quoted-printable The following commit has been merged into the timers/core branch of tip: Commit-ID: 19b344a91ff79f65be377825635bcf5f5bb8df67 Gitweb: https://git.kernel.org/tip/19b344a91ff79f65be377825635bcf5f5bb= 8df67 Author: Frederic Weisbecker AuthorDate: Sun, 25 Feb 2024 23:55:08 +01:00 Committer: Thomas Gleixner CommitterDate: Mon, 26 Feb 2024 11:37:32 +01:00 timers: Assert no next dyntick timer look-up while CPU is offline The next timer (re-)evaluation, with the purpose of entering/updating the dyntick mode, can happen from 3 sites and none of them are relevant while the CPU is offline: 1) The idle loop: a) From the quick check helping the cpuidle governor to heuristically predict the best C-state. b) While stopping the tick. But if the CPU is offline, the tick has been cancelled and there is consequently no need to further stop the tick. 2) Remote expiry: when a CPU remotely expires global timers on behalf of another CPU, the latter target's next timer is re-evaluated afterwards. However remote exp=C3=AEry doesn't happen on offline CPUs. 3) IRQ exit: on nohz_full mode, the tick is (re-)evaluated on IRQ exit. But full dynticks is disabled on offline CPUs. Therefore it is safe to assume that no next dyntick timer lookup can be performed on offline CPUs. Assert this expectation to report any surprise. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240225225508.11587-17-frederic@kernel.org --- kernel/time/timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 4f4930d..e69e75d 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2233,10 +2233,10 @@ static inline u64 __get_next_timer_interrupt(unsigned= long basej, u64 basem, bool idle_is_possible; =20 /* - * Pretend that there is no timer pending if the cpu is offline. - * Possible pending timers will be migrated later to an active cpu. + * When the CPU is offline, the tick is cancelled and nothing is supposed + * to try to stop it. */ - if (cpu_is_offline(smp_processor_id())) { + if (WARN_ON_ONCE(cpu_is_offline(smp_processor_id()))) { if (idle) *idle =3D true; return tevt.local;