2016-03-09 20:09:15

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 0/2] MIPS/PA-RISC: panic immediately when panic_on_oops

Hi,

MIPS and PA-RISC want to sleep 5 seconds before panicking when
panic_on_oops is set, with no apparent reason. We should remove
this feature, since some users may want their systems to fail as
quickly as possible.

Users who want to delay reboot after panic can use PANIC_TIMEOUT.

Also, this change will unify the behaviour with other architectures.

Aaro Koskinen (2):
MIPS: panic immediately when panic_on_oops
PA-RISC: panic immediately when panic_on_oops

arch/mips/kernel/traps.c | 5 +----
arch/parisc/kernel/traps.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)

--
2.4.0


2016-03-09 20:09:07

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 1/2] MIPS: panic immediately when panic_on_oops

MIPS wants to sleep 5 seconds before panicking when panic_on_oops is set,
with no apparent reason. Remove this feature, since some users may want
their systems to fail as quickly as possible.

Users who want to delay reboot after panic can use PANIC_TIMEOUT.

Signed-off-by: Aaro Koskinen <[email protected]>
---
arch/mips/kernel/traps.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index bf14da9..5756740 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -398,11 +398,8 @@ void __noreturn die(const char *str, struct pt_regs *regs)
if (in_interrupt())
panic("Fatal exception in interrupt");

- if (panic_on_oops) {
- printk(KERN_EMERG "Fatal exception: panic in 5 seconds");
- ssleep(5);
+ if (panic_on_oops)
panic("Fatal exception");
- }

if (regs && kexec_should_crash(current))
crash_kexec(regs);
--
2.4.0

2016-03-09 20:09:24

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 2/2] PA-RISC: panic immediately when panic_on_oops

PA-RISC wants to sleep 5 seconds before panicking when panic_on_oops
is set, with no apparent reason. Remove this feature, since some users
may want their systems to fail as quickly as possible.

Users who want to delay reboot after panic can use PANIC_TIMEOUT.

Signed-off-by: Aaro Koskinen <[email protected]>
---
arch/parisc/kernel/traps.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 553b098..16e0735 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -284,11 +284,8 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
if (in_interrupt())
panic("Fatal exception in interrupt");

- if (panic_on_oops) {
- printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
- ssleep(5);
+ if (panic_on_oops)
panic("Fatal exception");
- }

oops_exit();
do_exit(SIGSEGV);
--
2.4.0

2016-03-09 21:03:57

by Helge Deller

[permalink] [raw]
Subject: Re: [PATCH 2/2] PA-RISC: panic immediately when panic_on_oops

On 09.03.2016 21:08, Aaro Koskinen wrote:
> PA-RISC wants to sleep 5 seconds before panicking when panic_on_oops
> is set, with no apparent reason.

That's not completely true.
A few years back, when we had lots of crashes, it was very useful to at least
have some time to see the crash before the oops was cleaned from the screen.
Today the parisc port is really stable.

> Remove this feature, since some users
> may want their systems to fail as quickly as possible.
>
> Users who want to delay reboot after panic can use PANIC_TIMEOUT.

That's OK.

> Signed-off-by: Aaro Koskinen <[email protected]>

Acked-by: Helge Deller <[email protected]>


> ---
> arch/parisc/kernel/traps.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
> index 553b098..16e0735 100644
> --- a/arch/parisc/kernel/traps.c
> +++ b/arch/parisc/kernel/traps.c
> @@ -284,11 +284,8 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
> if (in_interrupt())
> panic("Fatal exception in interrupt");
>
> - if (panic_on_oops) {
> - printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
> - ssleep(5);
> + if (panic_on_oops)
> panic("Fatal exception");
> - }
>
> oops_exit();
> do_exit(SIGSEGV);
>

2016-03-10 00:09:33

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH 0/2] MIPS/PA-RISC: panic immediately when panic_on_oops

On Wed, Mar 09, 2016 at 10:08:41PM +0200, Aaro Koskinen wrote:

> MIPS and PA-RISC want to sleep 5 seconds before panicking when
> panic_on_oops is set, with no apparent reason. We should remove
> this feature, since some users may want their systems to fail as
> quickly as possible.
>
> Users who want to delay reboot after panic can use PANIC_TIMEOUT.
>
> Also, this change will unify the behaviour with other architectures.

I did a bit of dumpster diving, commit cea6a4ba8acfba6f59cc9ed71e0d05cb770b9d9c
("[PATCH] panic_on_oops: remove ssleep()") removed the 5 second delay
from ARM, i386, ia64, powerpc, x86_64 and xtensa on 2006-03-07.

The idea once upon a time probably was to keep the panic message on the
console long enough so somebody has _maybe_ a chance to read it. Which
is a pretty weak solution.

Ralf