From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@digeo.com>
Cc: wli@holomorphy.com, davem@redhat.com, rohit.seth@intel.com,
davidm@napali.hpl.hp.com, anton@samba.org, linux-mm@kvack.org
Subject: Re: hugepage patches
Date: 03 Feb 2003 22:37:51 -0700 [thread overview]
Message-ID: <m1hebk1u8g.fsf@frodo.biederman.org> (raw)
In-Reply-To: <20030203132929.40f0d9c0.akpm@digeo.com>
Andrew Morton <akpm@digeo.com> writes:
> ebiederm@xmission.com (Eric W. Biederman) wrote:
> >
> > >
> > > Expanding ftruncate would be nice, but the current way of performing
> > > the page instantiation at mmap() time seems sufficient.
> >
> > Having an expanding/shrinking ftruncate will trivially allow posix shared
> > memory semantics.
> >
> > I am trying to digest the idea of a mmap that grows a file. There isn't
> > anything else that works that way is there?
>
> Not that I can think of.
>
> > It looks like you are removing the limit checking from hugetlbfs, by
> > removing the expansion code from ftruncate.
>
> There was no expansion code.
inode->i_size was grown, but I admit no huge pages were allocated.
> The code I took out was vestigial. We can put it all back if we decide to
> add a new expand-with-ftruncate feature to hugetlbfs.
>
> > And given the fact that
> > nothing else grows in mmap, I suspect the code will be much easier to
> > write and maintain if the growth is constrained to happen in ftruncate.
>
> That would require a fault handler. We don't have one of those for hugetlbs.
> Probably not hard to add one though.
I don't see that ftruncate setting the size would require a fault
handler. ftruncate just needs to be called before mmap. But a fault
handler would certainly make the code more like the rest of the mmap
cases.
With a fault handler I start getting dangerous thoughts of paging
hugetlbfs to swap, probably not a good idea.
> > I may be missing something but it looks like there is not code present
> > to prevent multiple page allocations at the same time conflicting
> > when i_size is grown.
>
> All the mmap code runs under down_write(current->mm->mmap_sem);
Last I looked i_size is commonly protected by inode->i_sem.
current->mm->mmap_sem really doesn't provide protection if there is
a shared area between mappings in two different mm's. Not a problem
if the code is a private mapping but otherwise...
Does hugetlbfs support shared mappings? If it is exclusively
for private mappings the code makes much more sense than I am
thinking.
Eric
--
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/
next prev parent reply other threads:[~2003-02-04 5:37 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-31 23:15 hugepage patches Andrew Morton
2003-01-31 23:13 ` David S. Miller
2003-01-31 23:36 ` Andrew Morton
2003-01-31 23:23 ` David S. Miller
2003-01-31 23:45 ` Andrew Morton
2003-01-31 23:48 ` David S. Miller
2003-01-31 23:16 ` Andrew Morton
2003-01-31 23:17 ` Andrew Morton
2003-01-31 23:18 ` Andrew Morton
2003-01-31 23:18 ` Andrew Morton
2003-02-01 8:58 ` Ingo Oeser
2003-02-01 9:31 ` Andrew Morton
2003-02-01 10:00 ` William Lee Irwin III
2003-02-01 10:14 ` Andrew Morton
2003-02-02 10:55 ` Andrew Morton
2003-02-02 10:55 ` Andrew Morton
2003-02-02 19:59 ` William Lee Irwin III
2003-02-02 20:49 ` Andrew Morton
2003-02-03 15:09 ` Eric W. Biederman
2003-02-03 21:29 ` Andrew Morton
2003-02-04 5:37 ` Eric W. Biederman [this message]
2003-02-04 5:50 ` William Lee Irwin III
2003-02-04 7:06 ` Eric W. Biederman
2003-02-04 7:16 ` Martin J. Bligh
2003-02-04 12:40 ` Eric W. Biederman
2003-02-04 15:55 ` Martin J. Bligh
2003-02-05 12:18 ` Eric W. Biederman
2003-02-04 21:12 ` Andrew Morton
2003-02-05 12:25 ` Eric W. Biederman
2003-02-05 19:57 ` Andrew Morton
2003-02-05 20:00 ` Andrew Morton
2003-02-02 10:55 ` Andrew Morton
2003-02-02 10:56 ` Andrew Morton
2003-02-02 20:06 ` William Lee Irwin III
2003-02-02 10:56 ` Andrew Morton
2003-02-02 10:56 ` Andrew Morton
2003-02-02 10:57 ` Andrew Morton
2003-02-02 10:57 ` Andrew Morton
2003-02-02 20:17 ` William Lee Irwin III
2003-02-02 10:57 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2003-02-07 21:49 Seth, Rohit
2003-02-07 22:00 ` Andrew Morton
2003-02-07 22:02 Seth, Rohit
2003-02-07 22:24 ` Andrew Morton
2003-02-08 1:47 Seth, Rohit
2003-02-08 2:02 ` Andrew Morton
2003-02-08 3:05 Seth, Rohit
2003-02-08 8:48 ` Andrew Morton
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=m1hebk1u8g.fsf@frodo.biederman.org \
--to=ebiederm@xmission.com \
--cc=akpm@digeo.com \
--cc=anton@samba.org \
--cc=davem@redhat.com \
--cc=davidm@napali.hpl.hp.com \
--cc=linux-mm@kvack.org \
--cc=rohit.seth@intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.