Skip to contentSkip to conversation

Preempt realtime Oops syslog

PATCH New Min Zhang 1 participant 1 message Feb 16, 2008

lore
Share & tools
lore

Min Zhang

author
#0 lore raw

PATCH 1/2 Preempt realtime Oops syslog

Add bust_spinlocks when kernel die from do_trap to flush Oops dump to syslog immediatly. Oops is missing from syslog if it is from non-preemptible section, because on PREEMPT_RT kernel, Oops printk doesn't wake up klogd from non-preemptible context; see release_console_sem in kernel/printk.c.

Tested by Oops in module_init and insmod that kernel module. The Oops is in non-preemptive context because modules are loaded from inside a realtime priority thread in a preemptive realtime kernel.

Only apply to PPC arch because bust_spinlocks has already been used by x86 and other architectures

arch/ppc/kernel/traps.c +1 -0
Index: rt-2.6/arch/ppc/kernel/traps.c
===================================================================
@@ -92,6 +92,7 @@ int die(const char * str, struct pt_regs
 	if (nl)
 		printk("\n");
 	show_regs(fp);
+	bust_spinlocks(0);
 	add_taint(TAINT_DIE);
 	spin_unlock_irq(&die_lock);
 	/* do_exit() should take care of panic'ing from an interrupt