All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: Blaisorblade <blaisorblade@yahoo.it>
Cc: Rik van Riel <riel@redhat.com>,
	user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Re: madvise(DONTNEED) on tmpfs pages instead of /dev/anon
Date: Fri, 12 Aug 2005 12:38:17 -0400	[thread overview]
Message-ID: <20050812163817.GA7448@ccure.user-mode-linux.org> (raw)
In-Reply-To: <200508102136.43763.blaisorblade@yahoo.it>

On Wed, Aug 10, 2005 at 09:36:43PM +0200, Blaisorblade wrote:
> About this, I was thinking back to what Rik said in Ottawa at the OLS. He said 
> "just use madvise(DONTNEED) on it", but I remarked that the pages were 
> file-backed.

> Actually, however, since backing store for tmpfs is just pagecache/swapcache 
> memory,

They are still file-backed, just the underlying filesystem is often tmpfs.

> I have the doubt that madvise(DONTNEED) already does what we need, and if not 
> that it might be easily fixed (since zap_page_range->unmap_vmas -> 
> unmap_page_range accept a range of pages to be flushed - that was a recent 
> change from Hugh Dickins).

The man page is silent about whether the pages are synced to their
backing store, and in any case, tmpfs hsa no real backing store.

The desired behavior is that such pages are dropped as though they
were clean, even if they are dirty.  It goes against the grain of a
filesystem to drop dirty pages on the floor.

Looking at the code, the comment above madvise_dontneed is promising:

/*
 * Application no longer needs these pages.  If the pages are dirty,
 * it's OK to just throw them away.  The app will be more careful about
 * data it wants to keep.  Be sure to free swap resources too.  

which sounds like exactly what we need.

And in zap_pte_range, I don't see any checking of PageDirty, so it
looks like this works.

				Jeff


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2005-08-12 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-10 19:36 [uml-devel] madvise(DONTNEED) on tmpfs pages instead of /dev/anon Blaisorblade
2005-08-12 16:38 ` Jeff Dike [this message]
2005-08-12 17:00   ` [uml-devel] " Blaisorblade
2005-08-22 20:24     ` Jeff Dike
2005-08-26 15:06       ` Blaisorblade

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=20050812163817.GA7448@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=blaisorblade@yahoo.it \
    --cc=riel@redhat.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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.