From: "Eugene V. Lyubimkin" <jackyf.devel@gmail.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Peter Zijlstra <peterz@infradead.org>,
Chris Friesen <cfriesen@nortel.com>,
Rik van Riel <riel@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm <linux-mm@kvack.org>
Subject: Re: mmap: is default non-populating behavior stable?
Date: Wed, 05 Nov 2008 19:50:39 +0200 [thread overview]
Message-ID: <4911DCEF.80904@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0811051613400.21353@blonde.site>
[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]
Hugh Dickins wrote:
>> Thanks to all for answers. I have made the conclusion that doing "open() new
>> file, truncate(<big size>), mmap(<the same big size>), write/read some memory
>> pages" should not populate other, untouched by write/read pages (until
>> MAP_POPULATE given), right?
[snip]
> For a start, it depends on the filesystem: I believe that vfat, for
> example, does not support the concept of sparse files (files with holes
> in), so its truncate(<big size>) will allocate the whole of that big
> size initially.
For my case vfat is not an option fortunately.
> I'm not sure what you mean by "populate": in mm, as in MAP_POPULATE,
> we're thinking of prefaulting pages into the user address space; but
> you're probably thinking of whether the blocks are allocated on disk?
Yes.
>>From time to time we toy with prefaulting adjacent pages when a fault
> occurs (though IIRC tests have proved disappointing in the past): we'd
> like to keep that option open, but it would go against your guidelines
> above to some extent.
It depends how is "adjacent" would count :) If several pages, probably not. If
millions or similar, that would be a problem. It's very convenient to use such
"open+truncate+mmap+write/read" behavior to make self-growing-on-demand cache
in memory with disk as back-end without remaps.
Thanks for descriptive answer.
--
Eugene V. Lyubimkin aka JackYF
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2008-11-05 17:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-03 21:57 mmap: is default non-populating behavior stable? Eugene V. Lyubimkin
2008-11-03 22:41 ` Peter Zijlstra
2008-11-03 22:41 ` Peter Zijlstra
2008-11-03 22:49 ` Rik van Riel
2008-11-03 22:49 ` Rik van Riel
2008-11-04 15:56 ` Chris Friesen
2008-11-04 15:56 ` Chris Friesen
2008-11-04 16:07 ` Peter Zijlstra
2008-11-04 16:07 ` Peter Zijlstra
2008-11-04 16:28 ` Alan Cox
2008-11-04 16:28 ` Alan Cox
2008-11-04 16:51 ` Eugene V. Lyubimkin
2008-11-05 16:42 ` Hugh Dickins
2008-11-05 16:42 ` Hugh Dickins
2008-11-05 16:54 ` Alan Cox
2008-11-05 16:54 ` Alan Cox
2008-11-05 17:50 ` Eugene V. Lyubimkin [this message]
2008-11-05 23:31 ` Hugh Dickins
2008-11-05 23:31 ` Hugh Dickins
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=4911DCEF.80904@gmail.com \
--to=jackyf.devel@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cfriesen@nortel.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=peterz@infradead.org \
--cc=riel@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 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.