From: Dave Hansen <haveblue@us.ibm.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Adam Litke <agl@us.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@kvack.org, kenchen@google.com,
apw@shadowen.org
Subject: Re: [PATCH 2/5] hugetlb: Fix quota management for private mappings
Date: Wed, 31 Oct 2007 11:25:22 -0700 [thread overview]
Message-ID: <1193855122.6271.18.camel@localhost> (raw)
In-Reply-To: <Pine.LNX.4.64.0710311033160.21194@schroedinger.engr.sgi.com>
On Wed, 2007-10-31 at 10:33 -0700, Christoph Lameter wrote:
> On Wed, 31 Oct 2007, Adam Litke wrote:
>
> > > The private pointer in the first page of a compound page is always
> > > available. However, why do we not use page->mapping for that purpose?
> > > Could we stay as close as possible to regular page cache field use?
> >
> > There is an additional problem I forgot to mention in the previous mail.
> > The remove_from_page_cache() call path clears page->mapping. This means
> > that if the free_huge_page destructor is called on a previously shared
> > page, we will not have the needed information to release quota. Perhaps
> > this is a further indication that use of page->mapping at this level is
> > inappropriate.
>
> How does quota handle that for regular pages? Can you update the quotas
> before the page is released?
It should happen for normal pages at truncate time, which happens when
i_nlink hits zero. We also truncate these a whole file at a time.
I think the hugetlbfs problem is that we want to release pages at unmap
(and thus put_page()) time. If we have an unlinked hugetlbfs file which
has 100 huge pages in it, but only a single huge page still mapped, we
probably don't want to wait around to free those hundred pages waiting
for that last user.. That's for the private pages because their last
ref is always from the ptes.
Shared should be a different matter because that ref comes from the page
cache (generally, I guess).
So, hugetlbfs has a need to release pages _earlier_ in the process than
a normal page, at least for private mappings. The complication comes
because the private mappings really aren't file-backed in the sense that
they don't have entries in any address_space, but we still need
file-like inode operations on them. Gah.
-- Dave
--
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-31 18:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 20:45 [PATCH 0/5] hugetlb: Fix up filesystem quota accounting Adam Litke
2007-10-30 20:46 ` [PATCH 1/5] hugetlb: Split alloc_huge_page into private and shared components Adam Litke
2007-10-30 20:46 ` [PATCH 2/5] hugetlb: Fix quota management for private mappings Adam Litke
2007-10-30 23:22 ` Andrew Morton
2007-10-30 23:28 ` Christoph Lameter
2007-10-31 13:26 ` Adam Litke
2007-10-31 14:54 ` Adam Litke
2007-10-31 17:33 ` Christoph Lameter
2007-10-31 18:25 ` Dave Hansen [this message]
2007-10-31 18:42 ` Hugh Dickins
2007-10-30 20:46 ` [PATCH 3/5] hugetlb: Debit quota in alloc_huge_page Adam Litke
2007-10-30 20:46 ` [PATCH 4/5] hugetlb: Allow bulk updating in hugetlb_*_quota() Adam Litke
2007-10-30 20:46 ` [PATCH 5/5] hugetlb: Enforce quotas during reservation for shared mappings Adam Litke
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=1193855122.6271.18.camel@localhost \
--to=haveblue@us.ibm.com \
--cc=agl@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=apw@shadowen.org \
--cc=clameter@sgi.com \
--cc=kenchen@google.com \
--cc=linux-kernel@kvack.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).