From: Andrew Morton <akpm@osdl.org>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: jdike@addtoit.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC] /dev/anon
Date: Wed, 14 Jan 2004 14:32:21 -0800 [thread overview]
Message-ID: <20040114143221.25dd7c7e.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0401140749100.1829-100000@bigblue.dev.mdolabs.com>
Davide Libenzi <davidel@xmailserver.org> wrote:
>
> On Wed, 14 Jan 2004, Jeff Dike wrote:
>
> > > I thought your goal was to release memory
> > > to the host, that's why I proposed sys_madvise(MADV_DONTNEED).
> >
> > It is, I want memory released immediately as though it were clean, and
> > MADV_DONTNEED doesn't help.
>
> Strange, I didn't notice this before. If you look at the comment in
> mm/madvise.c:madvise_dontneed, it advertises that dirty pages are actually
> thrown away (that would be what you're actually looking for). But if you
> go down to zap_page_range -> unmap_vmas -> unmap_page_range ->
> zap_pmd_range -> zap_pte_range, if the page is dirty, set_page_dirty ->
> __set_page_dirty_buffers pushes the page into the mapping dirty pages list
> and __mark_inode_dirty push the inode inside the superblock dirty list. So
> the comment seems to be wrong (I also verified this with a simple program,
> and pages are actually flushed).
>
We cannot invalidate the pages due to MADV_DONTNEED: there may be
freshly-allocated, unwritten file blocks associated with them. You'd have
to be playing games with write() amd MAP_SHARED to do this.
next prev parent reply other threads:[~2004-01-14 22:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-13 20:21 Jeff Dike
2004-01-13 20:38 ` Davide Libenzi
2004-01-14 1:42 ` Jeff Dike
2004-01-14 4:46 ` Davide Libenzi
2004-01-14 5:18 ` Nuno Silva
2004-01-14 14:41 ` Jeff Dike
2004-01-14 18:23 ` Davide Libenzi
2004-01-14 22:32 ` Andrew Morton [this message]
2004-01-14 22:45 ` Davide Libenzi
2004-01-16 12:16 ` Geert Uytterhoeven
2004-01-16 16:02 ` Andries Brouwer
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=20040114143221.25dd7c7e.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=davidel@xmailserver.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.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
Powered by JetHome