Commit e3e8a75d authored by Kirill Korotaev's avatar Kirill Korotaev Committed by Linus Torvalds

[PATCH] Extract and use wake_up_klogd()

Remove hack with printing space to wake up klogd.  Use explicit
wake_up_klogd().

See earlier discussion
http://groups.google.com/group/fa.linux.kernel/browse_frm/thread/75f496668409f58d/1a8f28983a51e1ff?lnk=st&q=wake_up_klogd+group%3Afa.linux.kernel&rnum=2#1a8f28983a51e1ffSigned-off-by: default avatarAlexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cefc8be8
...@@ -176,6 +176,7 @@ static inline void console_verbose(void) ...@@ -176,6 +176,7 @@ static inline void console_verbose(void)
} }
extern void bust_spinlocks(int yes); extern void bust_spinlocks(int yes);
extern void wake_up_klogd(void);
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
extern int panic_timeout; extern int panic_timeout;
extern int panic_on_oops; extern int panic_on_oops;
......
...@@ -783,6 +783,12 @@ int is_console_locked(void) ...@@ -783,6 +783,12 @@ int is_console_locked(void)
return console_locked; return console_locked;
} }
void wake_up_klogd(void)
{
if (!oops_in_progress && waitqueue_active(&log_wait))
wake_up_interruptible(&log_wait);
}
/** /**
* release_console_sem - unlock the console system * release_console_sem - unlock the console system
* *
...@@ -825,8 +831,8 @@ void release_console_sem(void) ...@@ -825,8 +831,8 @@ void release_console_sem(void)
console_locked = 0; console_locked = 0;
up(&console_sem); up(&console_sem);
spin_unlock_irqrestore(&logbuf_lock, flags); spin_unlock_irqrestore(&logbuf_lock, flags);
if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait)) if (wake_klogd)
wake_up_interruptible(&log_wait); wake_up_klogd();
} }
EXPORT_SYMBOL(release_console_sem); EXPORT_SYMBOL(release_console_sem);
......
...@@ -19,19 +19,11 @@ void __attribute__((weak)) bust_spinlocks(int yes) ...@@ -19,19 +19,11 @@ void __attribute__((weak)) bust_spinlocks(int yes)
if (yes) { if (yes) {
oops_in_progress = 1; oops_in_progress = 1;
} else { } else {
int loglevel_save = console_loglevel;
#ifdef CONFIG_VT #ifdef CONFIG_VT
unblank_screen(); unblank_screen();
#endif #endif
oops_in_progress = 0; oops_in_progress = 0;
/* wake_up_klogd();
* OK, the message is on the console. Now we call printk()
* without oops_in_progress set so that printk() will give klogd
* and the blanked console a poke. Hold onto your hats...
*/
console_loglevel = 15; /* NMI oopser may have shut the console up */
printk(" ");
console_loglevel = loglevel_save;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment