On Wednesday 09 February 2005 19:31, Paul Warren wrote:
> On Wed, Feb 09, 2005 at 09:08:08AM -0800, Anthony Brock wrote:
> > >>> Paul Warren <[EMAIL PROTECTED]> 02/09/05 07:12AM >>>
> > >
> > > Right, but the memory is mmapped to that file.  My understanding is
> >
> > that
> >
> > > the memory will only be synced with the disk when either (a) msync
> >
> > (or
> >
> > > munmap) gets called or (b) the kernel has nothing better to do.
> > >
> > > I'm assuming that (a) doesn't happen, and I wouldn't expect (b) to
> > > happen if the I/O system is otherwise engaged, so I don't understand
> > > where the performance gain comes from - it should all be in RAM
> >
> > anyway.
> >
> > Paul,
> >
> > Assuming that you assessment is correct, what happens when:
> >
> > 1. The system is idle (say, for 4 seconds).
> > 2. The host decides to swap-out the guest kernel and memory.
> > 3. Your user, in the middle of looking at his programming book, starts
> > typing again.

> A delay.  My original question was, does using tempfs do more than
> prevent the memory from getting swapped out?  We have developed a patch
> that mlock()s the memory (using a setuid helper app), and thus should
> stop it from getting swapped out.  Would using tempfs improve things
> further?

Well, this patch could be interesting (by sure it was never posted)... 
however, tmpfs does not mlock() the memory. It avoids that it needs to be 
sync'ed to the disk. ramfs also mlock()s the memory.

So, putting the memory file (and maybe even the UML binary) inside ramfs would 
be the simpler and better solution to everything. Note that within ramfs 
things cannot be swapped, so you may want to put the memory file inside tmpfs 
so that the host kernel has his chance to swap when needed.

Otherwise, you could configure swap on the guests (which could be slower) and 
prevent the host from doing any caching by filling its memory with UML 
instances... this should also be workable (leave a little free memory + swap 
for safeness, however; some kernels also have problems when running with no 
swap at all).

Bye
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to