From: Blaisorblade <blaisorblade@yahoo.it>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Badari Pulavarty <pbadari@us.ibm.com>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, hugh@veritas.com,
dvhltc@us.ibm.com, linux-mm@kvack.org, jdike@addtoit.com
Subject: Re: differences between MADV_FREE and MADV_DONTNEED
Date: Tue, 17 Jan 2006 02:06:09 +0100 [thread overview]
Message-ID: <200601170206.10212.blaisorblade@yahoo.it> (raw)
In-Reply-To: <20060116130649.GE15897@opteron.random>
On Monday 16 January 2006 14:06, Andrea Arcangeli wrote:
> Now that MADV_REMOVE is in, should we discuss MADV_FREE?
> MADV_FREE in Solaris is destructive and only works on anonymous memory,
I.e. it's a restriction of MADV_REMOVE. Is there anything conceivable relying
on errors or no behaviour on file-backed memory? If relying on errors we
could need an API, but if relying only on the NO-OP thing the correctness
semantics are already implemented. I.e. data are retained on both Solaris
MADV_FREE and Linux MADV_REMOVE for file-backed case, they get a different
semantics for caching.
> while MADV_DONTNEED seems to never be destructive (which I assume it
> means it's a noop on anonymous memory).
It could be a "swap it out", as mentioned in Linux comments on our madvise
semantics about "other Unices".
> Our MADV_DONTNEED is destructive on anonymous memory, while it's
> non-destructive on file mappings.
Indeed, not even that. See our madvise_dontneed() comment - dirty data are
discarded in both cases, and the comment suggests msync(MS_INVALIDATE). It
also speaks of "other implementation", which could also refer to Solaris.
> Perhaps we could move the destructive anonymous part of MADV_DONTNEED to
> MADV_FREE?
Why changing existing apps behaviour? That's nonsense, unless you have a
standard. Indeed, however, posix_madvise exists, and it's DONTNEED semantics
are the Solaris ones. Don't know past behaviour about "breaking existing to
comply to standards" (new syscall slot?).
> Or we could as well go relaxed and define MADV_FREE and MADV_DONTNEED
> the same way (that still leaves the question if we risk to break apps
> ported from solaris where MADV_DONTNEED is apparently always not
> destructive).
Provide our fine-grained semantics with new, not misunderstandable identifiers
(MADV_FREE_DISCARD, MADV_FREE_CACHE, for instance).
For current names, libc could provide a "let user choose the meaning of
things", like it does for signals with _BSD_SOURCE, _POSIX_SOURCE and so on.
> I only read the docs, I don't know in practice what MADV_DONTNEED does
> on solaris (does it return -EINVAL if run on anonymous memory or not?).
> http://docs.sun.com/app/docs/doc/816-5168/6mbb3hrgk?a=view
> BTW, I don't know how other specifications define MADV_FREE, but besides
> MADV_REMOVE I've also got the request to provide MADV_FREE in linux,
> this is why I'm asking. (right now I'm telling them to use #ifdef
> __linux__ #define MADV_FREE MADV_DONTNEED but that's quite an hack since
> it could break if we make MADV_DONTNEED non-destructive in the future)
Making their apps work by causing the same breakage to Linux apps is a better
idea?
> Thanks.
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
next prev parent reply other threads:[~2006-01-17 1:06 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1130366995.23729.38.camel@localhost.localdomain>
[not found] ` <20051028034616.GA14511@ccure.user-mode-linux.org>
[not found] ` <43624F82.6080003@us.ibm.com>
[not found] ` <20051028184235.GC8514@ccure.user-mode-linux.org>
[not found] ` <1130544201.23729.167.camel@localhost.localdomain>
[not found] ` <20051029025119.GA14998@ccure.user-mode-linux.org>
[not found] ` <1130788176.24503.19.camel@localhost.localdomain>
[not found] ` <20051101000509.GA11847@ccure.user-mode-linux.org>
2005-11-02 1:15 ` [PATCH] 2.6.14 patch for supporting madvise(MADV_FREE) Badari Pulavarty
2005-11-02 1:43 ` Andrea Arcangeli
2005-11-02 15:49 ` Badari Pulavarty
2005-11-02 16:12 ` [PATCH] 2.6.14 patch for supporting madvise(MADV_REMOVE) Badari Pulavarty
2005-11-02 19:54 ` New bug in patch and existing Linux code - race with install_page() (was: Re: [PATCH] 2.6.14 patch for supporting madvise(MADV_REMOVE)) Blaisorblade
2005-11-02 20:12 ` Hugh Dickins
2005-11-02 20:45 ` Hugh Dickins
2005-11-02 21:36 ` Badari Pulavarty
2005-11-02 21:55 ` Hugh Dickins
2005-11-02 22:02 ` Badari Pulavarty
2005-11-12 0:25 ` [PATCH] 2.6.14 patch for supporting madvise(MADV_REMOVE) Andrew Morton
2005-11-12 0:34 ` Badari Pulavarty
2005-11-12 1:43 ` Andrew Morton
2005-11-12 4:41 ` Badari Pulavarty
2006-01-16 13:06 ` differences between MADV_FREE and MADV_DONTNEED Andrea Arcangeli
2006-01-16 16:02 ` Suleiman Souhlal
2006-01-16 16:28 ` Andrea Arcangeli
2006-01-16 17:03 ` Suleiman Souhlal
2006-01-16 17:24 ` Andrea Arcangeli
2006-01-16 21:43 ` Eric W. Biederman
2006-01-17 0:24 ` Suleiman Souhlal
2006-01-17 1:04 ` Nicholas Miell
2006-01-17 12:43 ` Christoph Hellwig
2006-01-17 18:23 ` Eric W. Biederman
2006-01-17 22:55 ` Nicholas Miell
2007-03-01 18:11 ` Samuel Thibault
2006-01-17 19:06 ` Badari Pulavarty
2006-01-17 1:06 ` Blaisorblade [this message]
2006-01-17 1:33 ` Andrea Arcangeli
2005-11-12 0:34 ` [PATCH] 2.6.14 patch for supporting madvise(MADV_REMOVE) 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=200601170206.10212.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=akpm@osdl.org \
--cc=andrea@suse.de \
--cc=dvhltc@us.ibm.com \
--cc=hugh@veritas.com \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pbadari@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome