From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: "Eric W. Biederman" <ebiederm+eric@ccr.net>
Cc: Richard Guenther <richard.guenther@student.uni-tuebingen.de>,
Linux Kernel List <linux-kernel@vger.rutgers.edu>,
glame-devel@lists.sourceforge.net, Linux-MM <linux-mm@kvack.org>
Subject: Re: mmap/munmap semantics
Date: Wed, 23 Feb 2000 16:44:01 +0100 [thread overview]
Message-ID: <20000223164401.D5598@pcep-jamie.cern.ch> (raw)
In-Reply-To: <m1hff0fuiu.fsf@flinx.hidden>; from Eric W. Biederman on Tue, Feb 22, 2000 at 09:49:13PM -0600
Eric W. Biederman wrote:
> > For the second case either the munmap call needs to be extended or
> > some sort of madvise with a MADV_CLEAN flag?
> Poking holes is probably not what you want. The zeroing cost
> will be paid somewhere.
MADV_CLEAN, or perhaps a different syscall mdiscard() (as it's page
based and doesn't change vmas) looks utterly wrong for this application,
but it does have a very nice use for memory allocators.
With memory allocators you could use mdiscard to tell the kernel to
decide whether to replace a privately mapped page by its original
backing page.
For /dev/zero that means you can let the kernel decide whether to
reclaim the memory, or if the application can keep the page. The nice
part is that the decision can be deferred: you are simply informing the
kernel that a page can be reclaimed later on demand. But the
application doesn't need to know when the decision happens -- it assumes
it is immediate.
This is appropriate for freed memory areas, and is not something that
the application can do itself. mmaping /dev/zero over the page doesn't
work because that _always_ causes an undesirable zero copy, not to
mention expensive vma operations, when what you want is to simply mark
pages for potential reclaim _if_ the kernel decides it could reclaim the
page in the intervening time.
enjoy,
-- Jamie
--
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.eu.org/Linux-MM/
next prev parent reply other threads:[~2000-02-23 15:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-22 17:46 Richard Guenther
2000-02-22 18:36 ` James Antill
2000-02-22 18:41 ` Benjamin C.R. LaHaise
2000-02-23 10:57 ` Richard Guenther
2000-02-23 15:58 ` Benjamin C.R. LaHaise
2000-02-24 10:06 ` Richard Guenther
2000-02-22 21:48 ` Richard Gooch
2000-02-23 3:49 ` Eric W. Biederman
2000-02-23 11:14 ` Richard Guenther
2000-02-23 15:44 ` Jamie Lokier [this message]
2000-02-23 18:48 ` Stephen C. Tweedie
2000-02-24 2:35 ` Jamie Lokier
2000-02-24 12:13 ` Stephen C. Tweedie
2000-02-24 12:24 ` Richard Guenther
2000-02-24 13:51 ` Stephen C. Tweedie
2000-02-24 15:01 ` kernel
2000-02-24 15:03 ` Richard Guenther
2000-02-24 15:15 ` Jamie Lokier
2000-02-24 13:06 ` lars brinkhoff
2000-02-24 14:42 ` Jamie Lokier
2000-02-24 13:41 ` Eric W. Biederman
2000-02-24 13:49 ` Stephen C. Tweedie
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=20000223164401.D5598@pcep-jamie.cern.ch \
--to=lk@tantalophile.demon.co.uk \
--cc=ebiederm+eric@ccr.net \
--cc=glame-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=richard.guenther@student.uni-tuebingen.de \
/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