Skip to content

Commit e3e8a75

Browse files
Kirill KorotaevLinus Torvalds
authored andcommitted
[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#1a8f28983a51e1ff Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent cefc8be commit e3e8a75

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

‎include/linux/kernel.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ static inline void console_verbose(void)
176176
}
177177

178178
extern void bust_spinlocks(int yes);
179+
extern void wake_up_klogd(void);
179180
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
180181
extern int panic_timeout;
181182
extern int panic_on_oops;

‎kernel/printk.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,12 @@ int is_console_locked(void)
783783
return console_locked;
784784
}
785785

786+
void wake_up_klogd(void)
787+
{
788+
if (!oops_in_progress && waitqueue_active(&log_wait))
789+
wake_up_interruptible(&log_wait);
790+
}
791+
786792
/**
787793
* release_console_sem - unlock the console system
788794
*
@@ -825,8 +831,8 @@ void release_console_sem(void)
825831
console_locked = 0;
826832
up(&console_sem);
827833
spin_unlock_irqrestore(&logbuf_lock, flags);
828-
if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait))
829-
wake_up_interruptible(&log_wait);
834+
if (wake_klogd)
835+
wake_up_klogd();
830836
}
831837
EXPORT_SYMBOL(release_console_sem);
832838

‎lib/bust_spinlocks.c‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,11 @@ void __attribute__((weak)) bust_spinlocks(int yes)
1919
if (yes) {
2020
oops_in_progress = 1;
2121
} else {
22-
int loglevel_save = console_loglevel;
2322
#ifdef CONFIG_VT
2423
unblank_screen();
2524
#endif
2625
oops_in_progress = 0;
27-
/*
28-
* OK, the message is on the console. Now we call printk()
29-
* without oops_in_progress set so that printk() will give klogd
30-
* and the blanked console a poke. Hold onto your hats...
31-
*/
32-
console_loglevel = 15; /* NMI oopser may have shut the console up */
33-
printk(" ");
34-
console_loglevel = loglevel_save;
26+
wake_up_klogd();
3527
}
3628
}
3729

0 commit comments

Comments
 (0)