kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: kexec@lists.infradead.org
Cc: Baoquan He <bhe@redhat.com>, chaowang@redhat.com
Subject: [PATCH] makedumpfile: add a new function update_cyclic_region_without_exclude for partial_bitmap1 setting
Date: Fri, 22 Nov 2013 20:07:22 +0800	[thread overview]
Message-ID: <1385122042-22959-1-git-send-email-bhe@redhat.com> (raw)

When use "--message-level 31" to do a kdump compressed dump, printing
message is not correct any more. Free pages number is doubled as below.

Original pages  : 0x000000000007539c
  Excluded pages   : 0x00000000000d986a
    Pages filled with zero  : 0x0000000000001196
    Cache pages             : 0x0000000000025008
    Cache pages + private   : 0x0000000000004baa
    User process data pages : 0x00000000000127d0
    Free pages              : 0x000000000009c352
    Hwpoison pages          : 0x0000000000000000
  Remaining pages  : 0xfffffffffff9bb32
  (The number of pages is reduced to 38418230895101%.)
Memory Hole     : 0x000000000000ac62
--------------------------------------------------
Total pages     : 0x000000000007fffe

After review code, it's caused by update_cyclic_region. This function calls
exclude_unnecessary_pages_cyclic to set partial_bitmap2, then free pages are
counted. But when write the 1st bitmap, it's also called though it is
useless, and pfn_free add free pages number. Here add a new function
update_cyclic_region_without_exclude which is used to set partial_bitmap1
specifically.
---
 makedumpfile.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 3746cf6..367e8cf 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -4745,6 +4745,26 @@ update_cyclic_region(unsigned long long pfn)
 	return TRUE;
 }
 
+
+int
+update_cyclic_region_without_exclude(unsigned long long pfn)
+{
+	if (is_cyclic_region(pfn))
+		return TRUE;
+
+	info->cyclic_start_pfn = round(pfn, info->pfn_cyclic);
+	info->cyclic_end_pfn = info->cyclic_start_pfn + info->pfn_cyclic;
+
+	if (info->cyclic_end_pfn > info->max_mapnr)
+		info->cyclic_end_pfn = info->max_mapnr;
+
+	if (info->flag_elf_dumpfile && !create_1st_bitmap_cyclic())
+		return FALSE;
+
+	return TRUE;
+}
+
+
 int
 copy_bitmap(void)
 {
@@ -6805,7 +6825,7 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
 	for (pfn = 0; pfn < info->max_mapnr; pfn++) {
 		if (is_cyclic_region(pfn))
 			continue;
-		if (!update_cyclic_region(pfn))
+		if (!update_cyclic_region_without_exclude(pfn))
 			return FALSE;
 		if (!create_1st_bitmap_cyclic())
 			return FALSE;
-- 
1.8.3.1


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

             reply	other threads:[~2013-11-22 12:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 12:07 Baoquan He [this message]
2013-11-23  9:29 ` [PATCH v2] makedumpfile: add parameters to update_cyclic_region Baoquan He
2013-11-25  2:31   ` Baoquan He
2013-11-25  4:33     ` HATAYAMA Daisuke
2013-11-26  2:52       ` Baoquan He
2013-11-26  3:12         ` Atsushi Kumagai
2013-11-27  5:37           ` Baoquan He
2013-11-27  7:37             ` HATAYAMA Daisuke
2013-12-02  8:43               ` Baoquan He
2013-11-26  5:50         ` HATAYAMA Daisuke
2013-11-26  7:57           ` Baoquan He
2013-11-26  8:50             ` HATAYAMA Daisuke
2013-11-26 10:24               ` Baoquan He
2013-11-26 11:59               ` Baoquan He

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=1385122042-22959-1-git-send-email-bhe@redhat.com \
    --to=bhe@redhat.com \
    --cc=chaowang@redhat.com \
    --cc=kexec@lists.infradead.org \
    /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).