2012-05-15 21:35:40

by Seiji Aguchi

[permalink] [raw]
Subject: [PATCH -tip] Move kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop()

Hi,

As Don mentioned in following thread, it would be nice for pstore/kmsg_dump to serialize
panic path because they can log messages reliably.

https://lkml.org/lkml/2011/10/13/427

This patch is based on Don's proposal switching smp_send_stop() from REBOOT_VECTOR to NMI
which has already merged to -tip tree.

https://lkml.org/lkml/2012/5/14/145

[Patch Description]
This patch just moves kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop for serializing
logging process via smp_send_stop.

Signed-off-by: Seiji Aguchi <[email protected]>
Acked-by: Don Zickus <[email protected]>

---
kernel/panic.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c index 80aed44..da585b8 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -108,8 +108,6 @@ void panic(const char *fmt, ...)
*/
crash_kexec(NULL);

- kmsg_dump(KMSG_DUMP_PANIC);
-
/*
* Note smp_send_stop is the usual smp shutdown function, which
* unfortunately means it may not be hardened to work in a panic @@ -117,6 +115,8 @@ void panic(const char *fmt, ...)
*/
smp_send_stop();

+ kmsg_dump(KMSG_DUMP_PANIC);
+
atomic_notifier_call_chain(&panic_notifier_list, 0, buf);

bust_spinlocks(0);
-- 1.7.1


2012-05-18 10:50:19

by Seiji Aguchi

[permalink] [raw]
Subject: [tip:core/debug] kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()

Commit-ID: f80f749132165fb083865e51afd65cf0f05dcd62
Gitweb: http://git.kernel.org/tip/f80f749132165fb083865e51afd65cf0f05dcd62
Author: Seiji Aguchi <[email protected]>
AuthorDate: Tue, 15 May 2012 17:35:09 -0400
Committer: Ingo Molnar <[email protected]>
CommitDate: Fri, 18 May 2012 10:07:37 +0200

kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()

This patch moves kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop(),
to serialize the crash-logging process via smp_send_stop() and to
thus retrieve a more stable crash image of all CPUs stopped.

Signed-off-by: Seiji Aguchi <[email protected]>
Acked-by: Don Zickus <[email protected]>
Cc: [email protected] <[email protected]>
Cc: Satoru Moriya <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: [email protected] <[email protected]>
Link: http://lkml.kernel.org/r/5C4C569E8A4B9B42A84A977CF070A35B2E4D7A5CE2@USINDEVS01.corp.hds.com
Signed-off-by: Ingo Molnar <[email protected]>
---
kernel/panic.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index b6215b7..d4f0b61 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -108,8 +108,6 @@ void panic(const char *fmt, ...)
*/
crash_kexec(NULL);

- kmsg_dump(KMSG_DUMP_PANIC);
-
/*
* Note smp_send_stop is the usual smp shutdown function, which
* unfortunately means it may not be hardened to work in a panic

2012-05-18 11:27:12

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [tip:core/debug] kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()

On Fri, 2012-05-18 at 03:49 -0700, tip-bot for Seiji Aguchi wrote:

> kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()
>
> This patch moves kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop(),
> to serialize the crash-logging process via smp_send_stop() and to
> thus retrieve a more stable crash image of all CPUs stopped.

I don't want to be a spoil sport or anything, but this patch doesn't
move anything, it just removes..

> ---
> kernel/panic.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/panic.c b/kernel/panic.c
> index b6215b7..d4f0b61 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -108,8 +108,6 @@ void panic(const char *fmt, ...)
> */
> crash_kexec(NULL);
>
> - kmsg_dump(KMSG_DUMP_PANIC);
> -
> /*
> * Note smp_send_stop is the usual smp shutdown function, which
> * unfortunately means it may not be hardened to work in a panic

2012-05-18 12:03:16

by Ingo Molnar

[permalink] [raw]
Subject: Re: [tip:core/debug] kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()


* Peter Zijlstra <[email protected]> wrote:

> On Fri, 2012-05-18 at 03:49 -0700, tip-bot for Seiji Aguchi wrote:
>
> > kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()
> >
> > This patch moves kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop(),
> > to serialize the crash-logging process via smp_send_stop() and to
> > thus retrieve a more stable crash image of all CPUs stopped.
>
> I don't want to be a spoil sport or anything, but this patch doesn't
> move anything, it just removes..

Hm, indeed. And the patch in the email is fine. I think I messed
up a conflict resolution ...

Should be fixed now.

Thanks,

Ingo

2012-05-18 12:11:51

by Seiji Aguchi

[permalink] [raw]
Subject: [tip:core/debug] kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()

Commit-ID: 62be73eafaa045d3233337303fb140f7f8a61135
Gitweb: http://git.kernel.org/tip/62be73eafaa045d3233337303fb140f7f8a61135
Author: Seiji Aguchi <[email protected]>
AuthorDate: Tue, 15 May 2012 17:35:09 -0400
Committer: Ingo Molnar <[email protected]>
CommitDate: Fri, 18 May 2012 14:02:10 +0200

kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()

This patch moves kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop(),
to serialize the crash-logging process via smp_send_stop() and to
thus retrieve a more stable crash image of all CPUs stopped.

Signed-off-by: Seiji Aguchi <[email protected]>
Acked-by: Don Zickus <[email protected]>
Cc: [email protected] <[email protected]>
Cc: Satoru Moriya <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: [email protected] <[email protected]>
Link: http://lkml.kernel.org/r/5C4C569E8A4B9B42A84A977CF070A35B2E4D7A5CE2@USINDEVS01.corp.hds.com
Signed-off-by: Ingo Molnar <[email protected]>
---
kernel/panic.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index b6215b7..d2a5f4e 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -108,8 +108,6 @@ void panic(const char *fmt, ...)
*/
crash_kexec(NULL);

- kmsg_dump(KMSG_DUMP_PANIC);
-
/*
* Note smp_send_stop is the usual smp shutdown function, which
* unfortunately means it may not be hardened to work in a panic
@@ -117,6 +115,8 @@ void panic(const char *fmt, ...)
*/
smp_send_stop();

+ kmsg_dump(KMSG_DUMP_PANIC);
+
atomic_notifier_call_chain(&panic_notifier_list, 0, buf);

bust_spinlocks(0);