Commit cea6a4ba authored by Horms's avatar Horms Committed by Linus Torvalds

[PATCH] panic_on_oops: remove ssleep()

This patch is part of an effort to unify the panic_on_oops behaviour across
all architectures that implement it.

It was pointed out to me by Andi Kleen that if an oops has occured in
interrupt context, then calling sleep() in the oops path will only cause a
panic, and that it would be really better for it not to be in the path at
all.

This patch removes the ssleep() call and reworks the console message
accordinly.  I have a slght concern that the resulting console message is
too long, feedback welcome.

For powerpc it also unifies the 32bit and 64bit behaviour.

Fror x86_64, this patch only updates the console message, as ssleep() is
already not present.
Signed-off-by: default avatarHorms <horms@verge.net.au>
Acked-by: default avatarPaul Mackerras <paulus@samba.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b8bdb460
...@@ -232,11 +232,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) ...@@ -232,11 +232,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
bust_spinlocks(0); bust_spinlocks(0);
spin_unlock_irq(&die_lock); spin_unlock_irq(&die_lock);
if (panic_on_oops) { if (panic_on_oops)
printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); panic("Fatal exception: panic_on_oops");
ssleep(5);
panic("Fatal exception");
}
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
......
...@@ -453,11 +453,9 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -453,11 +453,9 @@ void die(const char * str, struct pt_regs * regs, long err)
if (in_interrupt()) if (in_interrupt())
panic("Fatal exception in interrupt"); panic("Fatal exception in interrupt");
if (panic_on_oops) { if (panic_on_oops)
printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); panic("Fatal exception: panic_on_oops");
ssleep(5);
panic("Fatal exception");
}
oops_exit(); oops_exit();
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
......
...@@ -117,11 +117,8 @@ die (const char *str, struct pt_regs *regs, long err) ...@@ -117,11 +117,8 @@ die (const char *str, struct pt_regs *regs, long err)
die.lock_owner = -1; die.lock_owner = -1;
spin_unlock_irq(&die.lock); spin_unlock_irq(&die.lock);
if (panic_on_oops) { if (panic_on_oops)
printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); panic("Fatal exception: panic_on_oops");
ssleep(5);
panic("Fatal exception");
}
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
......
...@@ -150,13 +150,9 @@ int die(const char *str, struct pt_regs *regs, long err) ...@@ -150,13 +150,9 @@ int die(const char *str, struct pt_regs *regs, long err)
if (in_interrupt()) if (in_interrupt())
panic("Fatal exception in interrupt"); panic("Fatal exception in interrupt");
if (panic_on_oops) { if (panic_on_oops)
#ifdef CONFIG_PPC64 panic("Fatal exception: panic_on_oops");
printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
ssleep(5);
#endif
panic("Fatal exception");
}
do_exit(err); do_exit(err);
return 0; return 0;
......
...@@ -529,7 +529,7 @@ void __kprobes oops_end(unsigned long flags) ...@@ -529,7 +529,7 @@ void __kprobes oops_end(unsigned long flags)
/* Nest count reaches zero, release the lock. */ /* Nest count reaches zero, release the lock. */
spin_unlock_irqrestore(&die_lock, flags); spin_unlock_irqrestore(&die_lock, flags);
if (panic_on_oops) if (panic_on_oops)
panic("Oops"); panic("Fatal exception: panic_on_oops");
} }
void __kprobes __die(const char * str, struct pt_regs * regs, long err) void __kprobes __die(const char * str, struct pt_regs * regs, long err)
......
...@@ -487,11 +487,9 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -487,11 +487,9 @@ void die(const char * str, struct pt_regs * regs, long err)
if (in_interrupt()) if (in_interrupt())
panic("Fatal exception in interrupt"); panic("Fatal exception in interrupt");
if (panic_on_oops) { if (panic_on_oops)
printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); panic("Fatal exception: panic_on_oops");
ssleep(5);
panic("Fatal exception");
}
do_exit(err); do_exit(err);
} }
......
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