Skip to content

Commit

Permalink
[PATCH] invert irq/migration.c brach prediction
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Walker authored and Linus Torvalds committed Jun 23, 2006
1 parent d20d04b commit 89d0cf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/irq/migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);

Expand Down

0 comments on commit 89d0cf0

Please sign in to comment.