Skip to contentSkip to conversation

kexec: do not call kmsg_dump in crashdump

PATCH In review Dave Young 4 participants 5 messages Nov 25, 2011 – Nov 28, 2011

Subsystems (6)
lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 1/1 kexec: do not call kmsg_dump in crashdump

mtd/ram oops dumper will make more functions envolved. In case crash kexec, we should avoid kmsg dumper to ensure crashdump success.

kill kmsg_dump callback while crash dumping

---
 kernel/kexec.c |    2 --
 1 file changed, 2 deletions(-)
kernel/kexec.c +0 -2
@@ -1094,8 +1094,6 @@ void crash_kexec(struct pt_regs *regs)
 		if (kexec_crash_image) {
 			struct pt_regs fixed_regs;
 
-			kmsg_dump(KMSG_DUMP_KEXEC);
-
 			crash_setup_regs(&fixed_regs, regs);
 			crash_save_vmcoreinfo();
 			machine_crash_shutdown(&fixed_regs);

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 4 lines · Dave Young

mtd/ram oops dumper will make more functions envolved. In case crash kexec, we should avoid kmsg dumper to ensure crashdump success.

kill kmsg_dump callback while crash dumping

https://lkml.org/lkml/2011/2/1/33

author
#2 lore raw
Quoted 7 lines · Cong Wang
Quoted 4 lines · Dave Young

mtd/ram oops dumper will make more functions envolved. In case crash kexec, we should avoid kmsg dumper to ensure crashdump success.

kill kmsg_dump callback while crash dumping

https://lkml.org/lkml/2011/2/1/33

Thanks for give the link. So it's intend to be that.

I'm still confused with the KMSG_DUMP_KEXEC.

crash_kexec()
kmsg_dump(KMSG_DUMP_KEXEC)
kmsg_dump(KMSG_DUMP_PANIC)

Looks like it's equal to original logic, isn't it?

kmsg_dump(anything);
crash_kexec()

So why intruduce KMSG_DUMP_KEXEC? why not just kmsg_dump before crash_kexec?

thoughts?

Signature · 7 lines
Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#3 lore raw
In reply to Dave Young
Quoted 4 lines · Dave Young

mtd/ram oops dumper will make more functions envolved. In case crash kexec, we should avoid kmsg dumper to ensure crashdump success.

kill kmsg_dump callback while crash dumping

Agreed.

There is a similar? Or possibly the same patch already queued in Andrews tree.

Eric

Quoted 17 lines
---
 kernel/kexec.c |    2 --
 1 file changed, 2 deletions(-)
kernel/kexec.c +0 -2
@@ -1094,8 +1094,6 @@ void crash_kexec(struct pt_regs *regs)
 		if (kexec_crash_image) {
 			struct pt_regs fixed_regs;
 
-			kmsg_dump(KMSG_DUMP_KEXEC);
-
 			crash_setup_regs(&fixed_regs, regs);
 			crash_save_vmcoreinfo();
 			machine_crash_shutdown(&fixed_regs);
maintainer Acked-by Vivek Goyal Acked-by Jarod Wilson
#4 lore raw
Quoted 11 lines · On Mon, 28 Nov 2011 14:27:02 -0800 [email protected] (Eric W. Biederman)…
Quoted 4 lines · Dave Young

mtd/ram oops dumper will make more functions envolved. In case crash kexec, we should avoid kmsg dumper to ensure crashdump success.

kill kmsg_dump callback while crash dumping

Agreed.

There is a similar? Or possibly the same patch already queued in Andrews tree.

Below.

I've been sitting on this for ages because we couldn't seem to decide whether it was desirable. I think we decided a couple of weeks ago to merge it so I have it planned for 3.3 unless we re-re-re-decide again.

From: WANG Cong <[email protected]>
Subject: kexec: remove KMSG_DUMP_KEXEC

KMSG_DUMP_KEXEC is useless because we already save kernel messages inside /proc/vmcore, and it is unsafe to allow modules to do other stuffs in a crash dump scenario.

---

 arch/powerpc/platforms/pseries/nvram.c |    1 -
 drivers/char/ramoops.c                 |    3 +--
 drivers/mtd/mtdoops.c                  |    3 +--
 include/linux/kmsg_dump.h              |    1 -
 kernel/kexec.c                         |    3 ---
 5 files changed, 2 insertions(+), 9 deletions(-)
arch/powerpc/platforms/pseries/nvram.c renamed from arch/powerpc/platforms/pseries/nvram.c~kexec-remove-kmsg_dump_kexec +0 -1
diff -puN arch/powerpc/platforms/pseries/nvram.c~kexec-remove-kmsg_dump_kexec arch/powerpc/platforms/pseries/nvram.c
@@ -636,7 +636,6 @@ static void oops_to_nvram(struct kmsg_du
 		/* These are almost always orderly shutdowns. */
 		return;
 	case KMSG_DUMP_OOPS:
-	case KMSG_DUMP_KEXEC:
 		break;
 	case KMSG_DUMP_PANIC:
 		panicking = true;
drivers/char/ramoops.c renamed from drivers/char/ramoops.c~kexec-remove-kmsg_dump_kexec +1 -2
diff -puN drivers/char/ramoops.c~kexec-remove-kmsg_dump_kexec drivers/char/ramoops.c
@@ -83,8 +83,7 @@ static void ramoops_do_dump(struct kmsg_
 	struct timeval timestamp;
 
 	if (reason != KMSG_DUMP_OOPS &&
-	    reason != KMSG_DUMP_PANIC &&
-	    reason != KMSG_DUMP_KEXEC)
+	    reason != KMSG_DUMP_PANIC)
 		return;
 
 	/* Only dump oopses if dump_oops is set */
drivers/mtd/mtdoops.c renamed from drivers/mtd/mtdoops.c~kexec-remove-kmsg_dump_kexec +1 -2
diff -puN drivers/mtd/mtdoops.c~kexec-remove-kmsg_dump_kexec drivers/mtd/mtdoops.c
@@ -308,8 +308,7 @@ static void mtdoops_do_dump(struct kmsg_
 	char *dst;
 
 	if (reason != KMSG_DUMP_OOPS &&
-	    reason != KMSG_DUMP_PANIC &&
-	    reason != KMSG_DUMP_KEXEC)
+	    reason != KMSG_DUMP_PANIC)
 		return;
 
 	/* Only dump oopses if dump_oops is set */
include/linux/kmsg_dump.h renamed from include/linux/kmsg_dump.h~kexec-remove-kmsg_dump_kexec +0 -1
diff -puN include/linux/kmsg_dump.h~kexec-remove-kmsg_dump_kexec include/linux/kmsg_dump.h
@@ -18,7 +18,6 @@
 enum kmsg_dump_reason {
 	KMSG_DUMP_OOPS,
 	KMSG_DUMP_PANIC,
-	KMSG_DUMP_KEXEC,
 	KMSG_DUMP_RESTART,
 	KMSG_DUMP_HALT,
 	KMSG_DUMP_POWEROFF,
kernel/kexec.c renamed from kernel/kexec.c~kexec-remove-kmsg_dump_kexec +0 -3
diff -puN kernel/kexec.c~kexec-remove-kmsg_dump_kexec kernel/kexec.c
@@ -32,7 +32,6 @@
 #include <linux/console.h>
 #include <linux/vmalloc.h>
 #include <linux/swap.h>
-#include <linux/kmsg_dump.h>
 #include <linux/syscore_ops.h>
 
 #include <asm/page.h>
@@ -1094,8 +1093,6 @@ void crash_kexec(struct pt_regs *regs)
 		if (kexec_crash_image) {
 			struct pt_regs fixed_regs;
 
-			kmsg_dump(KMSG_DUMP_KEXEC);
-
 			crash_setup_regs(&fixed_regs, regs);
 			crash_save_vmcoreinfo();
 			machine_crash_shutdown(&fixed_regs);

_