From nobody Tue Apr 7 09:40:00 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0FB331F9AF for ; Fri, 13 Mar 2026 16:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773421114; cv=none; b=ZqDY+N9c7qXKYSdiBWJhVnxI2EAHbQb7gJKkQxY9Ek0l6Ve8pDtpHc9QsBfeogVd0IG3VUs5FlOgkhncqjcjp550p5QHfxGZFz7ZrboWLYBdkYsNnQB3Ren+YpkeSIYX7wJKddqEUNSGP88T0CbFVT3iGSFvDJea9/dEhTbjWNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773421114; c=relaxed/simple; bh=E4xjmXbQMZsSL9twktF001VB0Po/i1Xtc8jL4NfJMNs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=dqPIG9IbdXxY1KSB+IrRc3Zc/Q8jyWqS1kME8rN69aTwe1mOWQtPDiSil/ImARVupfS8qtmHH2epRmhdLj1fyj4TpB618z+JHJCL0lFnOKeueD4fzDK4sj4EMjQK4oIWp4QrfNlHztjRryfMD/6iXo0rjWLKbwb2c1Rz05VDAP0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TP6Vgq1V; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TP6Vgq1V" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4853bcdefd3so1940995e9.2 for ; Fri, 13 Mar 2026 09:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773421111; x=1774025911; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=K1+GQ1DJS9XbWAiFfkTydBohoj52U6GiccGbV5XrVS4=; b=TP6Vgq1VJajIz43hFUfNCKYmh87f/WHMFLuHLDkavhMBG39F52QKn1WsBkOI8Ar3SX AencXdir1IgOeIaQ8bsAHMmfZuEh/EanwyY310/xaRnYdgIAClL/DvE3ZUcSbSxvMpCr iYNWkS36+o7+BWh6sPKzmaI4Iqzx1s+HSGuo9xi6BGSDHX3hhqXAfVopFNXnQ1qBAtPo cHvEeVFpwaBKXAGmYJnMdTjzrAGjo8vercs8iuU12t0m3rFdMywlVsBL8dNvpZhxLDR5 o7FLsmJMkD94squokjlrxz6texfVbe6FMTz0XLz0Z/nspaxUAlYsKHcF/ZX1B2NZw1RM xUQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773421111; x=1774025911; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=K1+GQ1DJS9XbWAiFfkTydBohoj52U6GiccGbV5XrVS4=; b=Cr/rn+3eUEtOCoTg5BKK13DH25tyFVAgsgn1sQ7vERWUodjKNvdGv1/Q/6l0KXqMzQ IuThu7qRTVA2VzcYoDaELYO7Cfq3Ept44990UGBvK/F9qVzkvjS7zQFMGpsjbsGO1Aum fe04ulBrUsfHIpz6BMYrbGYYndwq97OCTCXoVWXcMSwEEvHvRDDRW7sch/6xfQ2XrHQt x6VoRgJDkQZN8QxxplvUwQk9UiSRyG/JV05BJhj9LbQi/AUucNCPNMBrBYhnLC6dqpRU Sz2j+5CrVgwKyS7mV30vCwygvZsPcuf+Hmm2/yFrHAUTjfiPJDnZrT5enV42rkOVT9tn DYWA== X-Forwarded-Encrypted: i=1; AJvYcCU3itzkBUgBHz7BOJbgMvHRBSW2zpp1Md1dJ6IPd85HJkjUHZJzR7YVgiAQTQEMduytaSx6PxizJsQZp7k=@vger.kernel.org X-Gm-Message-State: AOJu0YxeBgFHBICm9zmfYH23bt42dnkCgzAYT92RKCt6fsG+6AAekTvS EtI2GPltgzin29e9S2p9CVPjfp3rYYr82UJXyMZijyBS8aqS1Ze5R1c/ X-Gm-Gg: ATEYQzzHpxdy7ww1Nxnm8j4fgCZ6pL3qASLIzfPrhhcdoyWKjORuFml9cnw5P28Sh63 3pdxEReJUeoiPTh/CilNLX0R4RdqL6LZG1AyEeYvUw1GsNNDw+t2dHxkkEtl9xEh9r4VE79wQEY N80WTD3iZM8gdvy3QKxyVqrCwSA7NSLPnjCX6VKdYrXQ9fTskc6giSgUhMkgWYklPKf6ZlyRUmE qH0XD4+q3uIK9OPDm5Sj+j9rw0ivCf7CNvyqswMhICXBnFsB0Z1zs9krfFqKwlFSWvpy8psOdho JmnGpOVjVJWe5cTbsvEeJp46LJ8dG2U0ANSOOmsY83gc7lZSSe0vPgrjnQdocAiNBD1UnQXA2nv EhhDZYJTy5lG6p0rZfMPsQMb8j0CKFJXkig7VO0CxF2HZN7+sEDX2UKW+vBht8bn+p4a5nrjw+m HYg0DkAteCVDUu3LbRZQb8jFE2iFk= X-Received: by 2002:a05:600c:470c:b0:47d:6f12:de57 with SMTP id 5b1f17b1804b1-4855670f964mr37087165e9.4.1773421111016; Fri, 13 Mar 2026 09:58:31 -0700 (PDT) Received: from localhost ([2a03:2880:31ff:49::]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4854b65fd3dsm221670575e9.10.2026.03.13.09.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 09:58:30 -0700 (PDT) From: Gustavo Luiz Duarte Date: Fri, 13 Mar 2026 09:56:49 -0700 Subject: [PATCH] rcu: Add BOOTPARAM_RCU_STALL_PANIC Kconfig option Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260313-panic_on_rcustall-v1-1-a4f8fe54a4bd@gmail.com> X-B4-Tracking: v=1; b=H4sIANFBtGkC/x3MQQqAIBBA0avIrBPUqKirRITpWAOhohVBdPek5 Vv8/0DGRJhhYA8kvChT8AWyYmA27VfkZItBCdWKWtY8ak9mDn5O5syH3nfeN53ordSLUw5KFxM 6uv/nOL3vB84or4tjAAAA To: "Paul E. McKenney" , Breno Leitao , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, Gustavo Luiz Duarte X-Mailer: b4 0.13.0 Add a Kconfig option to set the default value of the kernel.panic_on_rcu_stall sysctl, allowing the kernel to be built with panic-on-RCU-stall enabled by default. This is useful for high-availability systems that require automatic recovery (via panic_timeout) when a CPU stall is detected, without needing userspace to configure the sysctl at boot. This follows the pattern established by BOOTPARAM_SOFTLOCKUP_PANIC and BOOTPARAM_HUNG_TASK_PANIC. The runtime sysctl can still override the Kconfig default. Signed-off-by: Gustavo Luiz Duarte Reviewed-by: Paul E. McKenney Tested-by: Breno Leitao --- kernel/rcu/Kconfig.debug | 24 ++++++++++++++++++++++++ kernel/rcu/tree_stall.h | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug index 625d75392647..fc2c775eeefc 100644 --- a/kernel/rcu/Kconfig.debug +++ b/kernel/rcu/Kconfig.debug @@ -175,6 +175,30 @@ config RCU_CPU_STALL_NOTIFIER Say Y here if you want RCU CPU stall notifiers (you don't want them) Say N if you are unsure. =20 +config BOOTPARAM_RCU_STALL_PANIC + bool "Panic (reboot) on RCU CPU stall" + depends on RCU_STALL_COMMON + default n + help + Say Y here to enable the kernel to panic when an RCU CPU stall + is detected. + + The panic can be used in combination with panic_timeout, + to cause the system to reboot automatically after an + RCU CPU stall has been detected. This feature is useful for + high-availability systems that have uptime guarantees and + where a CPU stall must be resolved ASAP. + + The kernel.max_rcu_stall_to_panic sysctl can be used to set + a minimum number of stalls before panicking, allowing the + system to tolerate a given number of RCU CPU stalls before + triggering a panic. + + This setting can be overridden at runtime via the + kernel.panic_on_rcu_stall sysctl parameter. + + Say N if unsure. + config RCU_TRACE bool "Enable tracing for RCU" depends on DEBUG_KERNEL diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index b67532cb8770..43ddabf46b5e 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -17,7 +17,7 @@ // Controlling CPU stall warnings, including delay calculation. =20 /* panic() on RCU Stall sysctl. */ -static int sysctl_panic_on_rcu_stall __read_mostly; +static int sysctl_panic_on_rcu_stall __read_mostly =3D IS_ENABLED(CONFIG_B= OOTPARAM_RCU_STALL_PANIC); static int sysctl_max_rcu_stall_to_panic __read_mostly; =20 static const struct ctl_table rcu_stall_sysctl_table[] =3D { --- base-commit: 1f318b96cc84d7c2ab792fcc0bfd42a7ca890681 change-id: 20260313-panic_on_rcustall-95709d1abf2f Best regards, --=20 Gustavo Luiz Duarte