summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-09-04 20:54:52 +0200
committerPaul E. McKenney <paulmck@kernel.org>2020-09-04 20:54:52 +0200
commit6fe208f63a79f4f726f3be2b78ea3dd40487b657 (patch)
tree1b826243b70f09e101081d5ea6dd59aa37fe25a9 /lib
parentMerge branch 'strictgp.2020.08.24a' into HEAD (diff)
parentsmp: Make symbol 'csd_bug_count' static (diff)
downloadlinux-6fe208f63a79f4f726f3be2b78ea3dd40487b657.tar.xz
linux-6fe208f63a79f4f726f3be2b78ea3dd40487b657.zip
Merge branch 'csd.2020.09.04a' into HEAD
csd.2020.09.04a: CPU smp_call_function() torture tests.
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug11
-rw-r--r--lib/nmi_backtrace.c6
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 0c3a6c752ede..4ac6f61b9475 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1377,6 +1377,17 @@ config SCF_TORTURE_TEST
module may be built after the fact on the running kernel to
be tested, if desired.
+config CSD_LOCK_WAIT_DEBUG
+ bool "Debugging for csd_lock_wait(), called from smp_call_function*()"
+ depends on DEBUG_KERNEL
+ depends on 64BIT
+ default n
+ help
+ This option enables debug prints when CPUs are slow to respond
+ to the smp_call_function*() IPI wrappers. These debug prints
+ include the IPI handler function currently executing (if any)
+ and relevant stack traces.
+
endmenu # lock debugging
config TRACE_IRQFLAGS
diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c
index 15ca78e1c7d4..8abe1870dba4 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 {