]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
smp-print-more-useful-debug-info-upon-receiving-ipi-on-an-offline-cpu-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 22 May 2014 00:44:05 +0000 (10:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:44:05 +0000 (10:44 +1000)
correctly suppress warning output on second and later occurrences

Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Gautham R Shenoy <ego@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Mike Galbraith <mgalbraith@suse.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Rik van Riel <riel@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/smp.c

index 6cb0e2ef9fe9f54c13109423d86a535e023a15c1..f864921fc82c1531d3647e68402a097ba205f569 100644 (file)
@@ -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.