linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>
To: linuxppc-dev <linuxppc-dev@ozlabs.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Anton Blanchard <anton@samba.org>,
	Amerigo Wang <amwang@redhat.com>,
	Kexec-ml <kexec@lists.infradead.org>,
	Milton Miller <miltonm@bga.com>,
	Randy Dunlap <rdunlap@xenotime.net>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: [RFC PATCH v5 7/9] fadump: Introduce cleanup routine to invalidate /proc/vmcore.
Date: Tue, 15 Nov 2011 20:44:18 +0530	[thread overview]
Message-ID: <20111115151418.16533.51406.stgit@mars.in.ibm.com> (raw)
In-Reply-To: <20111115151145.16533.16384.stgit@mars.in.ibm.com>

From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

With the firmware-assisted dump support we don't require a reboot when we
are in second kernel after crash. The second kernel after crash is a normal
kernel boot and has knowledge about entire system RAM with the page tables
initialized for entire system RAM. Hence once the dump is saved to disk, we
can just release the reserved memory area for general use and continue
with second kernel as production kernel.

Hence when we release the reserved memory that contains dump data, the
'/proc/vmcore' will not be valid anymore. Hence this patch introduces
a cleanup routine that invalidates and removes the /proc/vmcore file. This
routine will be invoked before we release the reserved dump memory area.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
 fs/proc/vmcore.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index cd99bf5..fae5526 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -699,3 +699,26 @@ static int __init vmcore_init(void)
 	return 0;
 }
 module_init(vmcore_init)
+
+/* Cleanup function for vmcore module. */
+void vmcore_cleanup(void)
+{
+	struct list_head *pos, *next;
+
+	if (proc_vmcore) {
+		remove_proc_entry(proc_vmcore->name, proc_vmcore->parent);
+		proc_vmcore = NULL;
+	}
+
+	/* clear the vmcore list. */
+	list_for_each_safe(pos, next, &vmcore_list) {
+		struct vmcore *m;
+
+		m = list_entry(pos, struct vmcore, list);
+		list_del(&m->list);
+		kfree(m);
+	}
+	kfree(elfcorebuf);
+	elfcorebuf = NULL;
+}
+EXPORT_SYMBOL_GPL(vmcore_cleanup);

  parent reply	other threads:[~2011-11-15 15:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 15:13 [RFC PATCH v5 0/9] fadump: Firmware-assisted dump support for Powerpc Mahesh J Salgaonkar
2011-11-15 15:13 ` [RFC PATCH v5 1/9] fadump: Add documentation for firmware-assisted dump Mahesh J Salgaonkar
2011-11-24 22:34   ` Paul Mackerras
2011-11-25 13:30     ` Mahesh J. Salgaonkar
2011-12-10  5:02     ` Mahesh Jagannath Salgaonkar
2011-11-15 15:13 ` [RFC PATCH v5 2/9] fadump: Reserve the memory for firmware assisted dump Mahesh J Salgaonkar
2011-11-24 23:02   ` Paul Mackerras
2011-11-28  6:21     ` Mahesh J. Salgaonkar
2011-11-15 15:13 ` [RFC PATCH v5 3/9] fadump: Register " Mahesh J Salgaonkar
2011-11-15 15:13 ` [RFC PATCH v5 4/9] fadump: Initialize elfcore header and add PT_LOAD program headers Mahesh J Salgaonkar
2011-11-15 15:14 ` [RFC PATCH v5 5/9] fadump: Convert firmware-assisted cpu state dump data into elf notes Mahesh J Salgaonkar
2011-11-15 15:14 ` [RFC PATCH v5 6/9] fadump: Add PT_NOTE program header for vmcoreinfo Mahesh J Salgaonkar
2011-11-15 15:14 ` Mahesh J Salgaonkar [this message]
2011-11-15 15:14 ` [RFC PATCH v5 8/9] fadump: Invalidate registration and release reserved memory for general use Mahesh J Salgaonkar
2011-11-15 15:14 ` [RFC PATCH v5 9/9] fadump: Invalidate the fadump registration during machine shutdown Mahesh J Salgaonkar
2011-11-21 12:03 ` [RFC PATCH v5 0/9] fadump: Firmware-assisted dump support for Powerpc Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111115151418.16533.51406.stgit@mars.in.ibm.com \
    --to=mahesh@linux.vnet.ibm.com \
    --cc=amwang@redhat.com \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=rdunlap@xenotime.net \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).