public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question: madvise(DONT_SYNC)
@ 2005-11-28  1:25 Rob Landley
  2005-11-29 16:51 ` Nix
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Landley @ 2005-11-28  1:25 UTC (permalink / raw)
  To: linux-kernel

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question: madvise(DONT_SYNC)
  2005-11-28  1:25 Question: madvise(DONT_SYNC) Rob Landley
@ 2005-11-29 16:51 ` Nix
  2005-11-29 20:06   ` Rob Landley
  0 siblings, 1 reply; 3+ messages in thread
From: Nix @ 2005-11-29 16:51 UTC (permalink / raw)
  To: Rob Landley; +Cc: linux-kernel

On 28 Nov 2005, Rob Landley whispered secretively:
> 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?

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

-- 
`Y'know, London's nice at this time of year. If you like your cities
 freezing cold and full of surly gits.' --- David Damerell


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question: madvise(DONT_SYNC)
  2005-11-29 16:51 ` Nix
@ 2005-11-29 20:06   ` Rob Landley
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Landley @ 2005-11-29 20:06 UTC (permalink / raw)
  To: Nix; +Cc: linux-kernel

On Tuesday 29 November 2005 10:51, Nix wrote:
> On 28 Nov 2005, Rob Landley whispered secretively:
> > 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. :)

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

Yup.  I agree that's a distro bug.  (Or possibly the one system I have access 
to is uniquely broken.)

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-29 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-28  1:25 Question: madvise(DONT_SYNC) Rob Landley
2005-11-29 16:51 ` Nix
2005-11-29 20:06   ` Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox