--- ./drivers/char/vt.c.dbgnmp	Mon Apr 24 12:42:51 2006
+++ ./drivers/char/vt.c	Wed May 24 12:38:57 2006
@@ -2238,8 +2238,10 @@ void vt_console_print(struct console *co
 	}
 	set_cursor(currcons);
 
-	if (!oops_in_progress)
-		poke_blanked_console();
+	if (!oops_in_progress) {
+		if (!printk_no_wake)
+			poke_blanked_console();
+	}
 
 quit:
 	clear_bit(0, &printing);
--- ./include/linux/console.h.dbgnmp	Sat Aug 14 14:55:19 2004
+++ ./include/linux/console.h	Wed May 24 12:38:57 2006
@@ -126,4 +126,22 @@ extern int is_console_locked(void);
 #define VESA_HSYNC_SUSPEND      2
 #define VESA_POWERDOWN          3
 
+
+#include <linux/preempt.h>
+#include <linux/cache.h>
+#include <linux/threads.h>
+
+struct printk_aligned {
+	int v;
+} ____cacheline_aligned;
+extern struct printk_aligned printk_no_wake_var[NR_CPUS];
+#define __printk_no_wake (printk_no_wake_var[smp_processor_id()].v)
+#define printk_no_wake ({ \
+			int v; \
+			preempt_disable(); \
+			v = __printk_no_wake; \
+			preempt_enable_no_resched(); \
+			v; \
+			})
+
 #endif /* _LINUX_CONSOLE_H */
--- ./kernel/printk.c.dbgnmp	Mon Apr 24 12:43:02 2006
+++ ./kernel/printk.c	Wed May 24 12:47:06 2006
@@ -59,6 +59,9 @@ EXPORT_SYMBOL(console_printk);
 int console_silence_loglevel;
 int oops_in_progress;
 
+struct printk_aligned printk_no_wake_var[NR_CPUS];
+EXPORT_SYMBOL(printk_no_wake_var);
+
 /*
  * console_sem protects the console_drivers list, and also
  * provides serialisation for access to the entire console
@@ -540,6 +543,8 @@ static void zap_locks(void)
 	init_MUTEX(&console_sem);
 }
 
+static unsigned long do_release_console_sem(unsigned long *flags);
+
 /*
  * This is printk.  It can be called from any context.  We want it to work.
  * 
@@ -611,6 +616,20 @@ asmlinkage int vprintk(const char *fmt, 
 		spin_unlock_irqrestore(&logbuf_lock, flags);
 		if (!oops_in_progress && need_wake)
 			wake_up_interruptible(&ve_log_wait);
+	} else if (__printk_no_wake) {
+		/*
+		 * A difficult case, created by the console semaphore mess...
+		 * All wakeups are omitted.
+		 */
+		if (!atomic_add_negative(-1, &console_sem.count)) {
+			console_locked = 1;
+			console_may_schedule = 0;
+			do_release_console_sem(&flags);
+			console_locked = 0;
+			console_may_schedule = 0;
+		}
+		atomic_inc(&console_sem.count);
+		spin_unlock_irqrestore(&logbuf_lock, flags);
 	} else if (!down_trylock(&console_sem)) {
 		console_locked = 1;
 		/*
@@ -634,6 +653,24 @@ out:
 
 EXPORT_SYMBOL(vprintk);
 
+static struct timer_list conswakeup_timer;
+static void conswakeup_timer_call(unsigned long dumy)
+{
+	if (!down_trylock(&console_sem))
+		release_console_sem();
+	mod_timer(&conswakeup_timer, jiffies + 5 * HZ);
+}
+
+static int __init conswakeup_init(void)
+{
+	init_timer(&conswakeup_timer);
+	conswakeup_timer.function = &conswakeup_timer_call;
+	conswakeup_timer.expires = jiffies + 5 * HZ;
+	add_timer(&conswakeup_timer);
+	return 0;
+}
+console_initcall(conswakeup_init);
+
 asmlinkage int printk(const char *fmt, ...)
 {
 	va_list args;
@@ -718,23 +755,33 @@ void wake_up_klogd(void)
  *
  * release_console_sem() may be called from any context.
  */
-void release_console_sem(void)
+static unsigned long do_release_console_sem(unsigned long *flags)
 {
-	unsigned long flags;
 	unsigned long _con_start, _log_end;
-	unsigned long wake_klogd = 0;
+	unsigned long wake_klogd;
 
+	wake_klogd = 0;
 	for ( ; ; ) {
-		spin_lock_irqsave(&logbuf_lock, flags);
 		wake_klogd |= log_start - log_end;
 		if (con_start == log_end)
 			break;			/* Nothing to print */
 		_con_start = con_start;
 		_log_end = log_end;
 		con_start = log_end;		/* Flush */
-		spin_unlock_irqrestore(&logbuf_lock, flags);
+		spin_unlock_irqrestore(&logbuf_lock, *flags);
 		call_console_drivers(_con_start, _log_end);
+		spin_lock_irqsave(&logbuf_lock, *flags);
 	}
+	return wake_klogd;
+}
+
+void release_console_sem(void)
+{
+	unsigned long wake_klogd;
+	unsigned long flags;
+
+	spin_lock_irqsave(&logbuf_lock, flags);
+	wake_klogd = do_release_console_sem(&flags);
 	console_locked = 0;
 	console_may_schedule = 0;
 	up(&console_sem);
--- ./lib/bust_spinlocks.c.dbgnmp	Mon Apr 24 12:42:43 2006
+++ ./lib/bust_spinlocks.c	Wed May 24 12:38:57 2006
@@ -13,9 +13,13 @@
 #include <linux/tty.h>
 #include <linux/wait.h>
 #include <linux/vt_kern.h>
+#include <linux/console.h>
 
 void bust_spinlocks(int yes)
 {
+	if (printk_no_wake)
+		return;
+
 	if (yes) {
 		oops_in_progress = 1;
 	} else {
