[<prev] [next>] [day] [month] [year] [list]
Message-ID: <160222534715.7002.9036613961207183639.tip-bot2@tip-bot2>
Date: Fri, 09 Oct 2020 06:35:47 -0000
From: "tip-bot2 for Paul E. McKenney" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Paul E. McKenney" <paulmck@...nel.org>,
Jonathan Corbet <corbet@....net>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
<linux-doc@...r.kernel.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: core/rcu] lib: Add backtrace_idle parameter to force backtrace
of idle CPUs
The following commit has been merged into the core/rcu branch of tip:
Commit-ID: 160c7ba34605d9b59ee406a1b4a61b0f942b1ae9
Gitweb: https://git.kernel.org/tip/160c7ba34605d9b59ee406a1b4a61b0f942b1ae9
Author: Paul E. McKenney <paulmck@...nel.org>
AuthorDate: Wed, 08 Jul 2020 16:25:43 -07:00
Committer: Paul E. McKenney <paulmck@...nel.org>
CommitterDate: Mon, 24 Aug 2020 14:24:25 -07:00
lib: Add backtrace_idle parameter to force backtrace of idle CPUs
Currently, the nmi_cpu_backtrace() declines to produce backtraces for
idle CPUs. This is a good choice in the common case in which problems are
caused only by non-idle CPUs. However, there are occasionally situations
in which idle CPUs are helping to cause problems. This commit therefore
adds an nmi_backtrace.backtrace_idle kernel boot parameter that causes
nmi_cpu_backtrace() to dump stacks even of idle CPUs.
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
Cc: Jonathan Corbet <corbet@....net>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: <linux-doc@...r.kernel.org>
---
Documentation/admin-guide/kernel-parameters.txt | 4 ++++
lib/nmi_backtrace.c | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index bdc1f33..5e6d191 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3073,6 +3073,10 @@
and gids from such clients. This is intended to ease
migration from NFSv2/v3.
+ nmi_backtrace.backtrace_idle [KNL]
+ Dump stacks even of idle CPUs in response to an
+ NMI stack-backtrace request.
+
nmi_debug= [KNL,SH] Specify one or more actions to take
when a NMI is triggered.
Format: [state][,regs][,debounce][,die]
diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c
index 15ca78e..8abe187 100644
--- a/lib/nmi_backtrace.c
+++ b/lib/nmi_backtrace.c
@@ -85,12 +85,16 @@ void nmi_trigger_cpumask_backtrace(const cpumask_t *mask,
put_cpu();
}
+// Dump stacks even for idle CPUs.
+static bool backtrace_idle;
+module_param(backtrace_idle, bool, 0644);
+
bool nmi_cpu_backtrace(struct pt_regs *regs)
{
int cpu = smp_processor_id();
if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
- if (regs && cpu_in_idle(instruction_pointer(regs))) {
+ if (!READ_ONCE(backtrace_idle) && regs && cpu_in_idle(instruction_pointer(regs))) {
pr_warn("NMI backtrace for cpu %d skipped: idling at %pS\n",
cpu, (void *)instruction_pointer(regs));
} else {
Powered by blists - more mailing lists