From: Vivek Goyal <vgoyal@redhat.com>
To: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: "d.hatayama@jp.fujitsu.com" <d.hatayama@jp.fujitsu.com>,
"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
"zzou@redhat.com" <zzou@redhat.com>,
"bhe@redhat.com" <bhe@redhat.com>
Subject: Re: [PATCH] makedumpfile: change the wrong code to calculate bufsize_cyclic for elf dump
Date: Mon, 21 Apr 2014 11:12:40 -0400 [thread overview]
Message-ID: <20140421151240.GB4367@redhat.com> (raw)
In-Reply-To: <0910DD04CBD6DE4193FCF86B9C00BE9720542E@BPXM01GP.gisp.nec.co.jp>
On Fri, Apr 18, 2014 at 09:22:26AM +0000, Atsushi Kumagai wrote:
> >On 04/17/14 at 12:52pm, Baoquan He wrote:
> >> On 04/17/14 at 04:01am, Atsushi Kumagai wrote:
> >> > Hello Baoquan,
> >> >
> >> > >Hi Atsushi,
> >> > >
> >> > >I have got the test machine where bug reported and did a test. The
> >> > >changed code can make elf dump successful.
> >> >
> >> > Great, thanks for your help!
> >> > However, I still have questions.
> >> >
> >> > First, what is the difference between yours and mine?
> >> >
> >> > http://lists.infradead.org/pipermail/kexec/2014-April/011535.html
> >>
> >> Yeah, you are right, it's the same on changing the code bug. I mush
> >> haven't read your patch carefully.
> > must<--
> >>
> >> >
> >> > My patch includes renaming some values, but the purpose looks
> >> > the same as yours.
> >> > Further, you described as below,
> >> >
> >> > >On 04/14/14 at 04:02pm, Baoquan He wrote:
> >> > but I still don't think this bug causes OOM.
> >> > Even if needed_size is calculated as so much size wrongly, bufsize_cyclic
> >> > will not exceed 40% of free memory by the check below:
> >> >
> >> > info->bufsize_cyclic = (free_size <= needed_size) ? free_size : needed_size;
> >> >
> >> > So it looks that bitmap1(40%) and bitmap2(40%) will fit in 80% of free
> >> > memory in any case.
> >> >
> >> > I may misunderstand something since your patch has an effect on this
> >> > issue in practice, could you correct me?
> >>
> >> It definitely will cause OOM. On my test machine, it has 100G memory. So
> >> per old code, its needed_size is 3200K*2 == 6.4M, if currently free
> >> memory is only 15M left, the free_size will be 15M*0.4 which is 6M. So
> >> info->bufsize_cyclic is assigned to be 6M. and only 3M is left for other
> >> use, e.g page cache, dynamic allocation. OOM will happen.
> >>
> >
> >BTW, in our case, there's about 30M free memory when we started saving
> >dump. It should be caused by my coarse estimation above.
>
> Thanks for your description, I understand that situation and
> the nature of the problem.
>
> That is, the assumption that 20% of free memory is enough for
> makedumpfile can be broken if free memory is too small.
> If your machine has 200GB memory, OOM will happen even after fix
> the too allocation bug.
Why? In cyclic mode, shouldn't makedumpfile's memory usage be fixed
and should not be dependent on amount of RAM present in the system?
Also, so even 30MB is not sufficient to run makedumpfile. That looks
like a lot of free memory to me.
>
> I don't think this is a problem, it's natural that a lack of memory
> causes OOM. However, there is a thing we can do for improvement.
>
> What I think is:
>
> 1. Use a constant value as safe limit to calculate bufsize_cyclic
> instead of 80% of free memory. This value must be enough for
> makedumpfile's work except bitmap.
>
> 2. If free memory is smaller than the value, makedumpfile gives up
> to work early.
What do we gain by makedumpfile giving up. System will reboot. System
will reboot anyway after OOM.
>
> This change may reduce the possibility of lack of memory, but the
> required memory size will be changing every version, so maintaining
> it sounds tough to me.
I think we need to dive deeper to figure out why 30MB of free memory
is not sufficient. To me something looks wrong here.
Secondly, I think using absolute values is not a good idea. It will be
very hard to keep track and udpate that value.
At max we can warn saying makedumpfile needs X MB of memory and only
Y MB of free memory is available.
Thanks
Vivek
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2014-04-21 15:13 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 ` [PATCH] makedumpfile: change the wrong code to calculate bufsize_cyclic for elf dump Baoquan He
2014-04-14 8:11 ` 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 [this message]
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=20140421151240.GB4367@redhat.com \
--to=vgoyal@redhat.com \
--cc=bhe@redhat.com \
--cc=d.hatayama@jp.fujitsu.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
--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).