From: Darren Hart <darren@dvhart.com>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: Robert Love <rml@novell.com>,
Samuel Thibault <samuel.thibault@ens-lyon.org>,
Andy Isaacson <adi@hexapodia.org>,
linux-kernel@vger.kernel.org
Subject: Re: wrong madvise(MADV_DONTNEED) semantic
Date: Tue, 05 Jul 2005 16:39:54 -0700 [thread overview]
Message-ID: <42CB1A4A.7000501@dvhart.com> (raw)
In-Reply-To: <20050628201704.GC4453@wohnheim.fh-wedel.de>
Jörn Engel wrote:
> On Tue, 28 June 2005 16:05:11 -0400, Robert Love wrote:
>
>>I like the idea (I think someone suggested this early on) of renaming
>>the current MADV_DONTNEED to MADV_FREE and then adding a correct
>>MADV_DONTNEED.
>
>
> Imo, that's still a crime against common sense. Madvice should give
> the kernel some advice about which data to keep or not to keep in
> memory, hence the name. It should *not* tell the kernel to corrupt
> data, which currently appears to be the case.
>
> If the application knows 100% that it is the _only_ possible user of
> this data and will never again use it, dropping dirty pages might be a
> sane option. Effectively that translates to anonymous memory only.
> In all other cases, dirty pages should be written back.
There is also the case of shmget/shmat memory segments. Some
applications will use these in order to map a very large amount of
memory and then madvise(MADV_DONTNEED) in order to play nice with the
rest of the system should memory pressure / system load / etc require
it. Obviously if other tasks have these segments mapped, the pages
cannot be discarded. If a task is the sole "mapper" of the region and
doesn't need that memory (ever again) it would be good to avoid the i/o
overhead of swapping it out and just discarding it. Perhaps
MADV_DONTNEED isn't the right place for this, but there is demand for
this behavior.
--Darren Hart
>
>
>>And, as I said, the man page needs clarification.
>
>
> Definitely.
>
> Jörn
>
next prev parent reply other threads:[~2005-07-05 23:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-28 13:43 wrong madvise(MADV_DONTNEED) semantic Samuel Thibault
2005-06-28 14:38 ` [Patch] Hotfix for " Jörn Engel
2005-06-28 18:16 ` Andy Isaacson
2005-06-28 18:28 ` Robert Love
2005-06-28 18:53 ` Andy Isaacson
2005-06-28 19:23 ` Robert Love
2005-06-28 19:41 ` Samuel Thibault
2005-06-28 20:03 ` Jörn Engel
2005-06-28 20:05 ` Robert Love
2005-06-28 20:17 ` Jörn Engel
2005-06-28 20:20 ` Samuel Thibault
2005-06-28 20:30 ` Jörn Engel
2005-06-28 20:37 ` Andy Isaacson
2005-07-05 23:39 ` Darren Hart [this message]
2005-06-29 16:53 ` wrong madvise(MADV DONTNEED) semantic Michael Kerrisk
2005-06-29 17:22 ` Jamie Lokier
2005-06-29 16:34 ` Michael Kerrisk
2005-06-28 18:54 ` wrong madvise(MADV_DONTNEED) semantic Samuel Thibault
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=42CB1A4A.7000501@dvhart.com \
--to=darren@dvhart.com \
--cc=adi@hexapodia.org \
--cc=dvhltc@us.ibm.com \
--cc=joern@wohnheim.fh-wedel.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@novell.com \
--cc=samuel.thibault@ens-lyon.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