From: Andrew Morton Date: Thu, 22 May 2014 00:44:05 +0000 (+1000) Subject: smp-print-more-useful-debug-info-upon-receiving-ipi-on-an-offline-cpu-fix X-Git-Tag: next-20140530~2^2~63 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ff3b5849fc1447f8e2e424fb71bf2d6f119f580f;p=karo-tx-linux.git smp-print-more-useful-debug-info-upon-receiving-ipi-on-an-offline-cpu-fix correctly suppress warning output on second and later occurrences Cc: "Paul E. McKenney" Cc: "Srivatsa S. Bhat" Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Frederic Weisbecker Cc: Gautham R Shenoy Cc: Ingo Molnar Cc: Mel Gorman Cc: Mike Galbraith Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Rik van Riel Cc: Rusty Russell Cc: Srivatsa S. Bhat Cc: Steven Rostedt Cc: Tejun Heo Cc: Thomas Gleixner Signed-off-by: Andrew Morton --- diff --git a/kernel/smp.c b/kernel/smp.c index 6cb0e2ef9fe9..f864921fc82c 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -185,20 +185,17 @@ void generic_smp_call_function_single_interrupt(void) { struct llist_node *entry; struct call_single_data *csd, *csd_next; - int warn = 0; - - /* - * Shouldn't receive this interrupt on a cpu that is not yet online. - */ - if (unlikely(!cpu_online(smp_processor_id()))) { - warn = 1; - WARN_ON_ONCE(1); - } + static bool warned; entry = llist_del_all(&__get_cpu_var(call_single_queue)); entry = llist_reverse_order(entry); - if (unlikely(warn)) { + /* + * Shouldn't receive this interrupt on a cpu that is not yet online. + */ + if (unlikely(!cpu_online(smp_processor_id()) && !warned)) { + warned = true; + WARN_ON(1); /* * We don't have to use the _safe() variant here * because we are not invoking the IPI handlers yet.