mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] -mm: make noirqdebug/irqfixup __read_mostly, add (un)likely()
@ 2006-04-21 16:51 Andreas Mohr
  0 siblings, 0 replies; only message in thread
From: Andreas Mohr @ 2006-04-21 16:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Ingo Molnar, linux-kernel

Hello all,

"noirqdebug" is checked in main IRQ handler, thus __read_mostly is useful.
Threw in an additional __read_mostly for "irqfixup" (that codepath is
enabled by default, too, thus also useful).
Add some (un)likely() in the hot paths of spurious IRQ detection code.

Patch compiled and tested on 2.6.17-rc1-mm3.
I did not test the arm part, though, for obvious reasons.

Those were the boring things, somewhat more interesting ones coming soon.

Thanks!

Signed-off-by: Andreas Mohr <andi@lisas.de>


--- linux-2.6.17-rc1-mm3.orig/kernel/irq/spurious.c	2006-04-18 11:45:16.000000000 +0200
+++ linux-2.6.17-rc1-mm3/kernel/irq/spurious.c	2006-04-21 18:14:19.000000000 +0200
@@ -11,7 +11,7 @@
 #include <linux/kallsyms.h>
 #include <linux/interrupt.h>
 
-static int irqfixup;
+static int irqfixup __read_mostly;
 
 /*
  * Recovery handler for misrouted interrupts.
@@ -138,7 +138,7 @@
 {
 	if (action_ret != IRQ_HANDLED) {
 		desc->irqs_unhandled++;
-		if (action_ret != IRQ_NONE)
+		if (unlikely(action_ret != IRQ_NONE))
 			report_bad_irq(irq, desc, action_ret);
 	}
 
@@ -152,7 +152,7 @@
 	}
 
 	desc->irq_count++;
-	if (desc->irq_count < 100000)
+	if (likely(desc->irq_count < 100000))
 		return;
 
 	desc->irq_count = 0;
@@ -171,7 +171,7 @@
 	desc->irqs_unhandled = 0;
 }
 
-int noirqdebug;
+int noirqdebug __read_mostly;
 
 int __init noirqdebug_setup(char *str)
 {
--- linux-2.6.17-rc1-mm3.orig/arch/arm/kernel/irq.c	2006-04-18 11:47:29.000000000 +0200
+++ linux-2.6.17-rc1-mm3/arch/arm/kernel/irq.c	2006-04-21 18:18:56.000000000 +0200
@@ -52,7 +52,7 @@
  */
 #define MAX_IRQ_CNT	100000
 
-static int noirqdebug;
+static int noirqdebug __read_mostly;
 static volatile unsigned long irq_err_count;
 static DEFINE_SPINLOCK(irq_controller_lock);
 static LIST_HEAD(irq_pending);
@@ -81,7 +81,7 @@
 
 void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
 {
-	irq_err_count += 1;
+	irq_err_count++;
 	printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-21 16:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-21 16:51 [PATCH] -mm: make noirqdebug/irqfixup __read_mostly, add (un)likely() Andreas Mohr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®