Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Walle <bwalle@suse.de>
To: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Cc: kexec@lists.infradead.org
Subject: [PATCH] [makedumpfile] Add `holes' in bitmap
Date: Fri, 18 May 2007 12:50:16 +0200	[thread overview]
Message-ID: <20070518105016.GG16227@suse.de> (raw)

On a big SGI machine with more than one node I experienced the problem that the
remaining buffer was larger than PFN_BUFBITMAP which resulted in an error.

I think the cause is that the holes must be filled in the bitmap. This patch
implements this.


Signed-off-by: Bernhard Walle <bwalle@suse.de>

---
 makedumpfile.c |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -3142,11 +3142,34 @@ create_dump_bitmap(struct DumpInfo *info
 	}
 
 	for (mm = 0; mm < info->num_mem_map; mm++) {
+		unsigned long long next_pfn_start;
+
 		mmd = &info->mem_map_data[mm];
 		pfn   = mmd->pfn_start;
 		paddr = pfn*info->page_size;
 		mem_map = mmd->mem_map;
 
+		/*
+		 * fill with zeros if start != 0
+		 */
+		if (mm == 0 && pfn != 0) {
+			int i;
+
+			for (;i < pfn; i++) {
+				set_bitmap(bm1.buf, i % BUFSIZE_BITMAP, 0);
+				set_bitmap(bm2.buf, i % BUFSIZE_BITMAP, 0);
+
+				if ((i % PFN_BUFBITMAP) == 0) {
+					bm1.buf_size = BUFSIZE_BITMAP;
+					bm2.buf_size = BUFSIZE_BITMAP;
+					if (!write_cache_bufsz(&bm1))
+						goto out;
+					if (!write_cache_bufsz(&bm2))
+						goto out;
+				}
+			}
+		}
+
 		if (mem_map == NOT_MEMMAP_ADDR)
 			not_found_mem_map = TRUE;
 		else
@@ -3291,6 +3314,34 @@ create_dump_bitmap(struct DumpInfo *info
 			 */
 			set_bitmap(bm2.buf, pfn%PFN_BUFBITMAP, val);
 		}
+
+		/*
+		 * fill the space between the memory maps with zeros
+		 */
+
+		if (mm != (info->num_mem_map - 1))
+			next_pfn_start = info->mem_map_data[mm+1].pfn_start;
+		else
+			next_pfn_start = info->max_mapnr;
+
+		for (; pfn < next_pfn_start; pfn++) {
+
+			/*
+			 * flush to disk
+			 */
+			if ((pfn % PFN_BUFBITMAP) == 0) {
+
+				bm1.buf_size = BUFSIZE_BITMAP;
+				bm2.buf_size = BUFSIZE_BITMAP;
+				if (!write_cache_bufsz(&bm1))
+					goto out;
+				if (!write_cache_bufsz(&bm2))
+					goto out;
+			}
+
+			set_bitmap(bm1.buf, pfn%PFN_BUFBITMAP, 0);
+			set_bitmap(bm2.buf, pfn%PFN_BUFBITMAP, 0);
+		}
 	}
 
 	/*

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

                 reply	other threads:[~2007-05-18 10:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070518105016.GG16227@suse.de \
    --to=bwalle@suse.de \
    --cc=kexec@lists.infradead.org \
    --cc=oomichi@mxs.nes.nec.co.jp \
    /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