public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: linux-kernel@vger.kernel.org
Subject: Question: madvise(DONT_SYNC)
Date: Sun, 27 Nov 2005 19:25:09 -0600	[thread overview]
Message-ID: <200511271925.09565.rob@landley.net> (raw)

I remember long ago a discussion about soft pinning of pages.  Not actually 
locking them into memory but just letting the VM know that when they get 
dirtied there's no need to ever write them out in the absence of memory 
pressure.

I don't remember how the discussion resolved, and I can't find anything that 
looks like MADV_NOSYNC in mman.h in the 2.6.15-rc2 headers.

I bring this up because User Mode Linux could use this behavior.  Under 2.4 it 
could get nosync file backed memory by simply deleting the file after mmaping 
it, but that hack was taken out in 2.6 and now you have to use a tmpfs mount 
to avoid a really nasty behavior (where every page you dirty gets written out 
and something like a kernel compile will peg the disk doing unnecessary 
writes for minutes at a time, which isn't fun even with CFQ).

UML is currently written on the assumption that tmpfs will be mounted on /tmp, 
but the only distribution I've been able to find that actually does that by 
default is knoppix (not because anything is mounted on /tmp, but because / is 
a union mount of iso9660 and tmpfs).  Fedora Core 4, Ubuntu, Gentoo all have 
tmpfs inheriting / (which is generally ext3).

Needing root access to set up the host system so that UML is usable defeats 
half the advantage it has over Xen, for my use cases.

I can change the default to /dev/pts (which is tmpfs with the sticky bit on 
Fedora Core 4, Ubuntu, and Gentoo.  But which has nothing mounted on it and 
isn't even world writable on the only x86-64 system I currently have access 
to, which is running PLD Linux...)  But if the madvise worked its mmap file 
could just be in the user's home directory, and it wouldn't need to hunt for 
a tmpfs mount at all...

Rob
-- 
Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.

             reply	other threads:[~2005-11-28  1:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-28  1:25 Rob Landley [this message]
2005-11-29 16:51 ` Question: madvise(DONT_SYNC) Nix
2005-11-29 20:06   ` Rob Landley

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=200511271925.09565.rob@landley.net \
    --to=rob@landley.net \
    --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