From nobody Wed Dec 17 23:29:23 2025 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 E58F720125E; Tue, 20 Aug 2024 06:30:18 +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=1724135421; cv=none; b=jM0dAzfM/JwMwsK2eM62pkbs+dKXOocFQLJe7tWFO/Fv+ldwYZoAaXUp9Y+sOBRESK8AnoWAcYB0hlV8mmISZF84h8rO3U09NPJ1Tx2YTY+CQ+ASRgWPWENySo1sJxmBFH33OJ7gmFo6/bXsVy4+4HXYBb8fsgIlv8oQTL3/Pek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724135421; c=relaxed/simple; bh=/gP8ujgnDmo/PH09xoPdDL8CnHUSID9dOyO0b21i7JQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Asd7c60x6knY8P7zvxUC42HEhmAkMhgPS737Qr6cX32bZ0YIiYzgrhBGNQpQrM4W1lL/qlC3n/Wt5s5nTRgVl1yyp5zbzR/geY4zLaXlJrPQubBZInJ+DmH8NRr5C9qOqWx+ZoP688LPuJRRjafvO6vMLr/Z8xh8k6yfF1NUIZU= 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=RWQQhQK0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=AgwzlLk3; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RWQQhQK0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="AgwzlLk3" From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1724135417; 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=+J3uNsDrypTBncR2y3/sDGkKGKO6SJ0tlRYJyvsQeNQ=; b=RWQQhQK0vgDd3fR8GeGCeBsYy0P8WQEMFf4pIyLxbUch16qUnL2xdyA2mNtACUQmCrl9nd kAkOYJmhthugeKH7kN3YBSXH4SvQlE5TnXg5bozVyzBq7f5mnhCnNWlc68PdjolVvi7tK2 oYRAqMvBFBPMToatKH0yPFQ96ecKj8vE5wHZlDhpxfF/siMylLk1IT+DhEanemKw5qLGlW 50jqH4E7kU7baFDj8tKHa/RYQMn8yPciM7AH8FeL7BVmUFtFR9ALSBn1wk7kbfX2DOCfEv POEsiOPE3auh1qNNStCNEGZ+Cf5Lof7esiUM0LF8Vc8Z5jODZGPTKdXWXF+yow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1724135417; 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=+J3uNsDrypTBncR2y3/sDGkKGKO6SJ0tlRYJyvsQeNQ=; b=AgwzlLk3MWT68ld51P1J/+vXa/UpEXd7yoJeBHgO5bkTPUPmFqvaMjJkk8wjC90awCqLUL ZVERsBm1z+L9dUAA== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Mathieu Desnoyers , Lai Jiangshan , Zqiang , rcu@vger.kernel.org Subject: [PATCH printk v8 34/35] rcu: Mark emergency sections in rcu stalls Date: Tue, 20 Aug 2024 08:36:00 +0206 Message-Id: <20240820063001.36405-35-john.ogness@linutronix.de> In-Reply-To: <20240820063001.36405-1-john.ogness@linutronix.de> References: <20240820063001.36405-1-john.ogness@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Mark emergency sections wherever multiple lines of rcu stall information are generated. In an emergency section, every printk() call will attempt to directly flush to the consoles using the EMERGENCY priority. Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- kernel/rcu/tree_exp.h | 7 +++++++ kernel/rcu/tree_stall.h | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h index 4acd29d16fdb..f6b35a0585a8 100644 --- a/kernel/rcu/tree_exp.h +++ b/kernel/rcu/tree_exp.h @@ -7,6 +7,7 @@ * Authors: Paul E. McKenney */ =20 +#include #include =20 static void rcu_exp_handler(void *unused); @@ -590,6 +591,9 @@ static void synchronize_rcu_expedited_wait(void) return; if (rcu_stall_is_suppressed()) continue; + + nbcon_cpu_emergency_enter(); + j =3D jiffies; rcu_stall_notifier_call_chain(RCU_STALL_NOTIFY_EXP, (void *)(j - jiffies= _start)); trace_rcu_stall_warning(rcu_state.name, TPS("ExpeditedStall")); @@ -643,6 +647,9 @@ static void synchronize_rcu_expedited_wait(void) rcu_exp_print_detail_task_stall_rnp(rnp); } jiffies_stall =3D 3 * rcu_exp_jiffies_till_stall_check() + 3; + + nbcon_cpu_emergency_exit(); + panic_on_rcu_stall(); } } diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index 4b0e9d7c4c68..b3a6943127bc 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -7,6 +7,7 @@ * Author: Paul E. McKenney */ =20 +#include #include #include =20 @@ -605,6 +606,8 @@ static void print_other_cpu_stall(unsigned long gp_seq,= unsigned long gps) if (rcu_stall_is_suppressed()) return; =20 + nbcon_cpu_emergency_enter(); + /* * OK, time to rat on our buddy... * See Documentation/RCU/stallwarn.rst for info on how to debug @@ -657,6 +660,8 @@ static void print_other_cpu_stall(unsigned long gp_seq,= unsigned long gps) rcu_check_gp_kthread_expired_fqs_timer(); rcu_check_gp_kthread_starvation(); =20 + nbcon_cpu_emergency_exit(); + panic_on_rcu_stall(); =20 rcu_force_quiescent_state(); /* Kick them all. */ @@ -677,6 +682,8 @@ static void print_cpu_stall(unsigned long gps) if (rcu_stall_is_suppressed()) return; =20 + nbcon_cpu_emergency_enter(); + /* * OK, time to rat on ourselves... * See Documentation/RCU/stallwarn.rst for info on how to debug @@ -706,6 +713,8 @@ static void print_cpu_stall(unsigned long gps) jiffies + 3 * rcu_jiffies_till_stall_check() + 3); raw_spin_unlock_irqrestore_rcu_node(rnp, flags); =20 + nbcon_cpu_emergency_exit(); + panic_on_rcu_stall(); =20 /* --=20 2.39.2