[PATCH] oops_in_progress is unlikely()

From: Mitchell Blank Jr
Date: Sun Sep 07 2003 - 01:45:36 EST


Andrew - thanks for applying my last patch; thought you might be interested
in this trivial one too. Patch is versus 2.6.0-test4-bk8, I expect it
will also apply against current -mm.

-Mitch

diff -urN -X dontdiff linux-2.6.0-test4bk8-VIRGIN/drivers/char/vt.c linux-2.6.0-test4bk8mnb1/drivers/char/vt.c
--- linux-2.6.0-test4bk8-VIRGIN/drivers/char/vt.c 2003-07-13 20:37:27.000000000 -0700
+++ linux-2.6.0-test4bk8mnb1/drivers/char/vt.c 2003-09-06 13:52:58.000000000 -0700
@@ -2179,7 +2179,7 @@
}
set_cursor(currcons);

- if (!oops_in_progress)
+ if (likely(!oops_in_progress))
poke_blanked_console();

quit:
diff -urN -X dontdiff linux-2.6.0-test4bk8-VIRGIN/drivers/parisc/led.c linux-2.6.0-test4bk8mnb1/drivers/parisc/led.c
--- linux-2.6.0-test4bk8-VIRGIN/drivers/parisc/led.c 2003-07-27 12:57:39.000000000 -0700
+++ linux-2.6.0-test4bk8mnb1/drivers/parisc/led.c 2003-09-06 13:53:18.000000000 -0700
@@ -488,7 +488,7 @@
}

/* blink all LEDs twice a second if we got an Oops (HPMC) */
- if (oops_in_progress) {
+ if (unlikely(oops_in_progress)) {
currentleds = (count_HZ<=(HZ/2)) ? 0 : 0xff;
}

diff -urN -X dontdiff linux-2.6.0-test4bk8-VIRGIN/kernel/printk.c linux-2.6.0-test4bk8mnb1/kernel/printk.c
--- linux-2.6.0-test4bk8-VIRGIN/kernel/printk.c 2003-07-13 20:39:24.000000000 -0700
+++ linux-2.6.0-test4bk8mnb1/kernel/printk.c 2003-09-06 13:53:50.000000000 -0700
@@ -400,7 +400,7 @@
static char printk_buf[1024];
static int log_level_unknown = 1;

- if (oops_in_progress) {
+ if (unlikely(oops_in_progress)) {
/* If a crash is occurring, make sure we can't deadlock */
spin_lock_init(&logbuf_lock);
/* And make sure that we print immediately */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/