From: "Ken Chen" <kenchen@google.com>
To: Adam Litke <agl@us.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mm <linux-mm@kvack.org>
Subject: Re: [patch] hugetlb: fix i_blocks accounting
Date: Tue, 23 Oct 2007 17:34:01 -0700 [thread overview]
Message-ID: <b040c32a0710231734j789b376fu93390f60e3d2ecdc@mail.gmail.com> (raw)
In-Reply-To: <1193151154.18417.39.camel@localhost.localdomain>
On 10/23/07, Adam Litke <agl@us.ibm.com> wrote:
> On Sat, 2007-10-20 at 11:18 -0700, Ken Chen wrote:
> > For administrative purpose, we want to query actual block usage for
> > hugetlbfs file via fstat. Currently, hugetlbfs always return 0. Fix
> > that up since kernel already has all the information to track it
> > properly.
>
> Hey Ken. You might want to wait on this for another minute or two. I
> will be sending out patches later today to fix up hugetlbfs quotas.
> Right now the code does not handle private mappings correctly (ie. it
> does not call get_quota() for COW pages and it never calls put_quota()
> for any private page). Because of this, your i_blocks number will be
> wrong most of the time.
Adam, speaking of hugetlb file system quota, there is another bug in
there for shared mapping as well.
At the time of mmap (MMAP_SHARED), kernel only check page reservation
against available hugetlb page pool. FS quota is not checked at all.
Now we over commit the fs quota for shared mapping, but still let the
mmap to succeed. At later point in the page fault path, app will
eventually die with SIGBUS due to lack of fs quota. This behavior
broke a few apps for us. The bad part is there is no easy recovery
path once a SIGBUS is raised.
I tried with MAP_POPULATE, but unfortunately it doesn't propagate
error code back up to user space on mmap; same thing with mlockall
that also ignores error code returned from make_pages_present().
Using mlock is at best half baked because VM_LOCKED maybe already set
via other means.
So this fs quota thing really needs some love and attention.
- Ken
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-10-24 0:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-20 18:18 [patch] hugetlb: fix i_blocks accounting Ken Chen
2007-10-23 14:52 ` Adam Litke
2007-10-24 0:34 ` Ken Chen [this message]
2007-10-24 13:06 ` Adam Litke
[not found] <b040c32a0711082343t2b94b495r1608d99ec0e28a4c@mail.gmail.com>
2007-11-09 17:31 ` Ken Chen
[not found] ` <1194617837.14675.45.camel@localhost.localdomain>
2007-11-09 17:42 ` Ken Chen
2007-11-09 18:09 ` aglitke
2007-11-10 1:16 ` Andrew Morton
2007-11-10 1:34 ` Ken Chen
2007-11-12 14:53 ` aglitke
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=b040c32a0710231734j789b376fu93390f60e3d2ecdc@mail.gmail.com \
--to=kenchen@google.com \
--cc=agl@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.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).