All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Andrew Morton <akpm@osdl.org>
Cc: jdike@addtoit.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] /dev/anon
Date: Wed, 14 Jan 2004 14:45:18 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0401141442520.2091-100000@bigblue.dev.mdolabs.com> (raw)
In-Reply-To: <20040114143221.25dd7c7e.akpm@osdl.org>

On Wed, 14 Jan 2004, Andrew Morton wrote:

> 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.

That's fine Andrew. It was the comment that looked strange to me. We 
actually do sync dirty pages, while the comment says we throw them away.



- Davide



  reply	other threads:[~2004-01-14 22:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-13 20:21 [RFC] /dev/anon 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
2004-01-14 22:45             ` Davide Libenzi [this message]
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=Pine.LNX.4.44.0401141442520.2091-100000@bigblue.dev.mdolabs.com \
    --to=davidel@xmailserver.org \
    --cc=akpm@osdl.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 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.