From: Adam Litke <agl@us.ibm.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Hugh Dickins <hugh@veritas.com>,
Kawai Hidehiro <hidehiro.kawai.ez@hitachi.com>,
William Irwin <wli@holomorphy.com>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] coredump_filter: add hugepage core dumping
Date: Fri, 29 Aug 2008 10:28:33 -0500 [thread overview]
Message-ID: <1220023713.14358.173.camel@localhost.localdomain> (raw)
In-Reply-To: <20080829082832.3C1D.KOSAKI.MOTOHIRO@jp.fujitsu.com>
On Fri, 2008-08-29 at 08:35 +0900, KOSAKI Motohiro wrote:
> Hi
>
> > > I think VM_RESERVED default dumping bahavior is good,
> > > then I'd like to add coredump_filter mask.
> > >
> > > This patch doesn't change dafault behavior.
> >
> > This seems very reasonable to me
> > (though I've little use for coredumps or hugepages myself).
>
> Thanks a lot.
>
> > One caution though: how well does it behave when coredumping a large
> > area of hugepages which have not actually been instantiated prior to
> > the coredump? We have that funny FOLL_ANON ZERO_PAGE code in
> > follow_page() to avoid wasting memory on large uninstantiated anon
> > areas, but hugepages won't go that way. If the dump hangs waiting for
> > memory to be freed, or OOMkills other processes, that wouldn't be good;
> > whereas if hugepage reservations (I've not followed what happens with
> > them) or whatever just make it skip when no more, that should be okay.
>
> I think hugepage reservation pages always exist when hugepage COW happend.
> Then, hugepage access never cause try_to_free_pages() nor OOM.
(Mel, since you wrote the private reservation hugetlb code, would you
care to verify the following:)
Well, reserved huge pages _almost_ always exist. The notable exception
happens when a process creates a MAP_PRIVATE hugetlb mapping and then
forks. No guarantees are made to the children for access to that
hugetlb mapping. So if such a child were to core dump an unavailable
huge page, follow_hugetlb_page() would fail. I think that case is
harmless since it looks like elf_coredump() will replace it with a
zeroed page?
The part of Hugh's email that does deserve more attention is the part
about FOLL_ANON and the ZERO_PAGE. It seems like an awful waste to zero
out and instantiate huge pages just for a core dump. I think it would
be worth adding a flag to follow_hugetlb_page() so that it can be
instructed to not fault in un-instantiated huge pages. This would take
some investigating as to whether it is even valid for
follow_hugetlb_page() to return the ZERO_PAGE().
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
next prev parent reply other threads:[~2008-08-29 15:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-28 5:24 [PATCH] coredump_filter: add hugepage core dumping KOSAKI Motohiro
2008-08-28 14:48 ` Adam Litke
2008-08-28 14:59 ` KOSAKI Motohiro
2008-08-28 16:38 ` Hugh Dickins
2008-08-28 23:35 ` KOSAKI Motohiro
2008-08-29 15:28 ` Adam Litke [this message]
2008-09-02 1:21 ` [PATCH] hugepage: support ZERO_PAGE() KOSAKI Motohiro
2008-09-02 14:22 ` Mel Gorman
2008-09-02 15:13 ` Mel Gorman
2008-09-02 16:27 ` Mel Gorman
2008-09-02 17:27 ` Adam Litke
2008-09-01 6:00 ` [PATCH] coredump_filter: add hugepage core dumping Hidehiro Kawai
2008-09-02 2:18 ` KOSAKI Motohiro
2008-09-02 13:48 ` Mel Gorman
2008-09-05 8:06 ` KOSAKI Motohiro
2008-09-08 1:51 ` Hidehiro Kawai
2008-09-09 11:20 ` KOSAKI Motohiro
2008-09-10 6:04 ` Roland McGrath
2008-09-10 6:53 ` KOSAKI Motohiro
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=1220023713.14358.173.camel@localhost.localdomain \
--to=agl@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=hugh@veritas.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wli@holomorphy.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