From: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: [PATCH] -mm: make noirqdebug/irqfixup __read_mostly, add (un)likely()
Date: Fri, 21 Apr 2006 18:51:58 +0200 [thread overview]
Message-ID: <20060421165158.GA5513@rhlx01.fht-esslingen.de> (raw)
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);
}
reply other threads:[~2006-04-21 16:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060421165158.GA5513@rhlx01.fht-esslingen.de \
--to=andi@rhlx01.fht-esslingen.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®