[PATCH 1/2] Preempt realtime Oops syslog

From: Min Zhang
Date: Fri Feb 15 2008 - 22:44:57 EST


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

Signed-off-by: Min Zhang <mzhang@xxxxxxxxxx>

Index: rt-2.6/arch/ppc/kernel/traps.c
===================================================================
--- rt-2.6.orig/arch/ppc/kernel/traps.c
+++ 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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/