Question: madvise(DONT_SYNC)
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
Signature · 2 lines
Steve Ballmer: Innovation! Inigo Montoya: You keep using that word. I do not think it means what you think it means.
On 28 Nov 2005, Rob Landley whispered secretively:
Quoted 2 lines
I can change the default to
/dev/pts(which is tmpfs with the sticky bit on Fedora Core 4, Ubuntu, and Gentoo.
Um, you mean /dev/shm, right?
Quoted 2 lines
But which has nothing mounted on it and
isn't even world writable on the only x86-64 system I currently have access
Well, shm_open() and friends just won't work on that system (the /dev/shm path is hardwired into glibc; I guess the PLD people might have hacked glibc to change that path, but that seems peculiar).
Distro bug.
Signature · 2 lines
`Y'know, London's nice at this time of year. If you like your cities freezing cold and full of surly gits.' --- David Damerell
Quoted 5 lines · Nix
On 28 Nov 2005, Rob Landley whispered secretively:
Quoted 2 lines
I can change the default to
/dev/pts(which is tmpfs with the sticky bit on Fedora Core 4, Ubuntu, and Gentoo.Um, you mean
/dev/shm, right?
Yes. :)
Quoted 9 lines
Quoted 3 lines
But which has nothing mounted on it
and isn't even world writable on the only x86-64 system I currently have accessWell,
shm_open()and friends just won't work on that system (the/dev/shmpath is hardwired into glibc; I guess the PLD people might have hacked glibc to change that path, but that seems peculiar).Distro bug.
Yup. I agree that's a distro bug. (Or possibly the one system I have access to is uniquely broken.)
Rob
Signature · 2 lines
Steve Ballmer: Innovation! Inigo Montoya: You keep using that word. I do not think it means what you think it means.