removes unnessary print of space v2, wakeup_klogd()
Subsystems (3)
PATCH 1/1 removes unnessary print of space v2, wakeup_klogd()
This patch removes unnessary print of space in bust_spinlocks() instead wake_up_klogd() is called.
Also it removes exact copies of lib/bust_spinlocks.c:bust_spinlocks() from 3 architectures.
Kirill
include/linux/kernel.h renamed from include/linux/kernel.h.printk +1 -0
@@ -131,6 +131,7 @@ static inline void console_verbose(void) }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 panic_on_oops;extern int tainted;
arch/i386/mm/fault.c renamed from arch/i386/mm/fault.c.printk +0 -26
@@ -30,32 +30,6 @@extern void die (const char *,struct pt_regs *,long );/* -* Unlock any spinlocks which will prevent us from getting the -* message out -*/ -void bust_spinlocks (int yes) -{ -int loglevel_save = console_loglevel; - -if (yes) { - oops_in_progress =1 ; -return ; - } -#ifdef CONFIG_VT -unblank_screen (); -#endif - oops_in_progress =0 ; -/* -* OK, the message is on the console. Now we call printk() -* without oops_in_progress set so that printk will give klogd -* a poke. Hold onto your hats... -*/ - console_loglevel =15 ;/* NMI oopser may have shut the console up */ -printk (" " ); - console_loglevel = loglevel_save; -} - -/* * Return EIP plus the CS segment base. The segment limit is also * adjusted, clamped to the kernel/user address space (whichever is * appropriate), and returned in *eip_limit.
arch/ia64/kernel/traps.c renamed from arch/ia64/kernel/traps.c.printk +0 -28
@@ -35,34 +35,6 @@ trap_init (void) fpswa_interface =__va (ia64_boot_param->fpswa); } -/* -* Unlock any spinlocks which will prevent us from getting the message out (timerlist_lock -* is acquired through the console unblank code) -*/ -void -bust_spinlocks (int yes) -{ -int loglevel_save = console_loglevel; - -if (yes) { - oops_in_progress =1 ; -return ; - } - -#ifdef CONFIG_VT -unblank_screen (); -#endif - oops_in_progress =0 ; -/* -* OK, the message is on the console. Now we call printk() without -* oops_in_progress set so that printk will give klogd a poke. Hold onto -* your hats... -*/ - console_loglevel =15 ;/* NMI oopser may have shut the console up */ -printk (" " ); - console_loglevel = loglevel_save; -} -void die (const char *str,struct pt_regs *regs,long err) {
arch/x86_64/mm/fault.c renamed from arch/x86_64/mm/fault.c.printk +0 -21
@@ -34,27 +34,6 @@#include <asm/kdebug.h> #include <asm-generic/sections.h> -void bust_spinlocks (int yes) -{ -int loglevel_save = console_loglevel; -if (yes) { - oops_in_progress =1 ; - }else { -#ifdef CONFIG_VT -unblank_screen (); -#endif - oops_in_progress =0 ; -/* -* OK, the message is on the console. Now we call printk() -* without oops_in_progress set so that printk will give klogd -* a poke. Hold onto your hats... -*/ - console_loglevel =15 ;/* NMI oopser may have shut the console up */ -printk (" " ); - console_loglevel = loglevel_save; - } -} -/* Sometimes the CPU reports invalid exceptions on prefetch. Check that here and ignore. Opcode checker based on code by Richard Brunner */
arch/s390/mm/fault.c renamed from arch/s390/mm/fault.c.printk +1 -9
@@ -61,17 +61,9 @@ void bust_spinlocks(int yes)if (yes) { oops_in_progress =1 ; }else { -int loglevel_save = console_loglevel; oops_in_progress =0 ;console_unblank (); -/* -* OK, the message is on the console. Now we call printk() -* without oops_in_progress set so that printk will give klogd -* a poke. Hold onto your hats... -*/ - console_loglevel =15 ; -printk (" " ); - console_loglevel = loglevel_save; +wake_up_klogd (); } }
kernel/printk.c renamed from kernel/printk.c.printk +8 -2
@@ -614,6 +614,12 @@ int is_console_locked(void) }EXPORT_SYMBOL (is_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 *
@@ -649,8 +655,8 @@ void release_console_sem(void) console_may_schedule =0 ;up (&console_sem);spin_unlock_irqrestore (&logbuf_lock, flags); -if (wake_klogd && !oops_in_progress &&waitqueue_active (&log_wait)) -wake_up_interruptible (&log_wait); +if (wake_klogd) +wake_up_klogd (); }EXPORT_SYMBOL (release_console_sem);
lib/bust_spinlocks.c renamed from lib/bust_spinlocks.c.printk +1 -12
@@ -14,26 +14,15 @@#include <linux/wait.h> #include <linux/vt_kern.h> -void bust_spinlocks (int yes) {if (yes) { oops_in_progress =1 ; }else { -int loglevel_save = console_loglevel;#ifdef CONFIG_VT unblank_screen ();#endif oops_in_progress =0 ; -/* -* 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; +wake_up_klogd (); } } - -