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 <[email protected]>
--- 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);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]