[PATCH] invert irq/migration.c brach prediction
authorDaniel Walker <dwalker@mvista.com>
Fri, 23 Jun 2006 09:05:29 +0000 (02:05 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 23 Jun 2006 14:43:04 +0000 (07:43 -0700)
If you get to that point in the code it means that desc->move_irq is set,
pending_irq_cpumask[irq] and cpu_online_map should have a value.  Still
pretty good chance anding those two you'll still have a value.  So these
two branch predictors should be inverted.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/irq/migration.c

index 134f9f2e0e3962cabf8859d6bc5581f9dfdfea16..a12d00eb5e7c01e9495704fbfdae248ab081ed8e 100644 (file)
@@ -30,7 +30,7 @@ void move_native_irq(int irq)
 
        desc->move_irq = 0;
 
-       if (likely(cpus_empty(pending_irq_cpumask[irq])))
+       if (unlikely(cpus_empty(pending_irq_cpumask[irq])))
                return;
 
        if (!desc->handler->set_affinity)
@@ -49,7 +49,7 @@ void move_native_irq(int irq)
         * cause some ioapics to mal-function.
         * Being paranoid i guess!
         */
-       if (unlikely(!cpus_empty(tmp))) {
+       if (likely(!cpus_empty(tmp))) {
                if (likely(!(desc->status & IRQ_DISABLED)))
                        desc->handler->disable(irq);