From: Baoquan He <bhe@redhat.com>
To: Arthur Zou <zzou@redhat.com>
Cc: kexec@lists.infradead.org, d hatayama <d.hatayama@jp.fujitsu.com>,
Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>,
vgoyal@redhat.com
Subject: [PATCH] makedumpfile: change the wrong code to calculate bufsize_cyclic for elf dump
Date: Mon, 14 Apr 2014 16:02:39 +0800 [thread overview]
Message-ID: <20140414080239.GA8084@dhcp-16-105.nay.redhat.com> (raw)
In-Reply-To: <585335973.3025244.1397211578378.JavaMail.zimbra@redhat.com>
In case elf dump, the code to calculate the cyclic buffer size is
not correct. Since elf need bitmap1/2, so the needed memory for
bufsize_cyclic need be double. Hence free size should be 40% of
free memory, however the needed_size which free_size is compared
with should be info->max_mapnr / BITPERBYTE, but not 2 times of it.
Because of this, in case of free memory in 2nd kernel is not too much,
OOM will happen very often.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
makedumpfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/makedumpfile.c b/makedumpfile.c
index 75092a8..01ec516 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -9010,7 +9010,7 @@ calculate_cyclic_buffer_size(void) {
*/
if (info->flag_elf_dumpfile) {
free_size = get_free_memory_size() * 0.4;
- needed_size = (info->max_mapnr * 2) / BITPERBYTE;
+ needed_size = info->max_mapnr / BITPERBYTE;
} else {
free_size = get_free_memory_size() * 0.8;
needed_size = info->max_mapnr / BITPERBYTE;
--
1.8.5.3
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2014-04-14 8:04 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 21:44 makedumpfile memmory usage seems high with option -E Vivek Goyal
2014-04-11 9:22 ` Atsushi Kumagai
2014-04-11 10:19 ` Arthur Zou
2014-04-14 8:02 ` Baoquan He [this message]
2014-04-14 8:11 ` [PATCH] makedumpfile: change the wrong code to calculate bufsize_cyclic for elf dump Baoquan He
2014-04-16 6:44 ` Baoquan He
2014-04-17 4:01 ` Atsushi Kumagai
2014-04-17 4:52 ` bhe
2014-04-17 5:02 ` bhe
2014-04-18 9:22 ` Atsushi Kumagai
2014-04-18 14:29 ` bhe
2014-04-18 19:41 ` Petr Tesarik
2014-04-21 15:19 ` Vivek Goyal
2014-04-21 15:46 ` Petr Tesarik
2014-04-21 15:51 ` Vivek Goyal
2014-04-21 15:14 ` Vivek Goyal
2014-04-23 11:09 ` bhe
2014-04-21 15:12 ` Vivek Goyal
2014-04-23 7:55 ` Atsushi Kumagai
2014-04-23 11:55 ` bhe
2014-04-23 17:08 ` Vivek Goyal
2014-04-23 23:50 ` bhe
2014-04-24 2:05 ` bhe
2014-04-25 13:22 ` Vivek Goyal
2014-04-28 5:05 ` Atsushi Kumagai
2014-04-28 12:50 ` Vivek Goyal
2014-05-09 5:36 ` Atsushi Kumagai
2014-05-09 20:49 ` Vivek Goyal
2014-05-15 7:22 ` bhe
2014-05-15 9:10 ` Atsushi Kumagai
2014-05-19 11:15 ` bhe
2014-05-19 15:11 ` Vivek Goyal
2014-05-27 5:34 ` Atsushi Kumagai
2014-05-27 14:49 ` Vivek Goyal
2014-05-23 7:18 ` Atsushi Kumagai
2014-05-14 5:44 ` bhe
2014-04-28 5:04 ` Atsushi Kumagai
2014-05-09 5:35 ` Atsushi Kumagai
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=20140414080239.GA8084@dhcp-16-105.nay.redhat.com \
--to=bhe@redhat.com \
--cc=d.hatayama@jp.fujitsu.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
--cc=vgoyal@redhat.com \
--cc=zzou@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).