Skip to content

Commit 641cd4c

Browse files
author
Ingo Molnar
committed
generic-ipi: eliminate WARN_ON()s during oops/panic
Do not output smp-call related warnings in the oops/panic codepath. Reported-by: Jan Beulich <jbeulich@novell.com> Acked-by: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <49B91A7E.76E4.0078.0@novell.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 25d5000 commit 641cd4c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎kernel/smp.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
#include <linux/rcupdate.h>
77
#include <linux/rculist.h>
8+
#include <linux/kernel.h>
89
#include <linux/module.h>
910
#include <linux/percpu.h>
1011
#include <linux/init.h>
@@ -285,7 +286,7 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
285286
this_cpu = get_cpu();
286287

287288
/* Can deadlock when called with interrupts disabled */
288-
WARN_ON(irqs_disabled());
289+
WARN_ON_ONCE(irqs_disabled() && !oops_in_progress);
289290

290291
if (cpu == this_cpu) {
291292
local_irq_save(flags);
@@ -329,7 +330,7 @@ void __smp_call_function_single(int cpu, struct call_single_data *data,
329330
csd_lock(data);
330331

331332
/* Can deadlock when called with interrupts disabled */
332-
WARN_ON(wait && irqs_disabled());
333+
WARN_ON_ONCE(wait && irqs_disabled() && !oops_in_progress);
333334

334335
generic_exec_single(cpu, data, wait);
335336
}
@@ -365,7 +366,7 @@ void smp_call_function_many(const struct cpumask *mask,
365366
int cpu, next_cpu, this_cpu = smp_processor_id();
366367

367368
/* Can deadlock when called with interrupts disabled */
368-
WARN_ON(irqs_disabled());
369+
WARN_ON_ONCE(irqs_disabled() && !oops_in_progress);
369370

370371
/* So, what's a CPU they want? Ignoring this one. */
371372
cpu = cpumask_first_and(mask, cpu_online_mask);

0 commit comments

Comments
 (0)