From: Jeff Dike <jdike@addtoit.com>
To: Matthew Bloch <matthew-list@bytemark.co.uk>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] [PATCH] Locking user-mode kernel RAM into host physical RAM
Date: Mon, 08 Dec 2003 14:01:31 -0500 [thread overview]
Message-ID: <200312081901.hB8J1VAv028738@ccure.user-mode-linux.org> (raw)
In-Reply-To: Your message of "Mon, 08 Dec 2003 16:39:08 GMT." <200312081639.22888.matthew-list@bytemark.co.uk>
As far as I'm concerned, this is papering over the symptoms rather than fixing
a real problem.
If you're really not overselling memory, then the host should not be swapping.
If it is, then that's the problem.
> My experience with 2.4 as a host kernel is that it will quite happily
> swap out pages from running applications to use as disc cache; this
> is apparently alleviated with 2.6's "swappiness" kernel parameter.
This being the case, you should maybe be looking at 2.6 as your host.
> I hope that it's obvious enough to warrant inclusion in the next
> release of the UML patch
It's not. Feel free to argue, but this is really the wrong thing to do, IMHO.
In any case, I have something different in the works.
First, there is ubd-mmap + /dev/anon. ubd-mmap makes the ubd driver mmap data
from its devices into its physical memory rather than copying it. This causes
UML to share the data with the host page cache rather than copying it into a
separate page of its own. This by itself reduces host memory consumption,
which will alleviate the swapping problem on the host. /dev/anon is a new
host driver which implements the munmap semantics needed by UML physical memory
(pages are release to the host when they're no longer mapped, even if they're
dirty). My /dev/anon driver is still buggy, but it works well enough to boot
and run UML, and get memory consumption measurements. On a simple
boot-my-Debian-image-to-a-login-prompt test, I get ~25% reduction in host
memory consumption and ~25% increase in the number of UMLs that run before the
host starts swapping. Giving credit where credit is due, this is thanks to
memset, which ponied up some money to make it happen.
A happy side-effect of the infrastructure needed to make this work is that
it is now possible to plug memory in and out of UMLs dynamically. This means
that host memory can now be managed by removing it from idle UMLs and giving
it to busy ones. This would be implemented by a daemon on the host monitoring
the memory state of the host and UMLs. The UML monitoring is made possible
by the mconsole proc interface which I added a while back. The daemon would
implement whatever policy the site wants.
A reasonable default policy is to keep the host from swapping. So, it would
shuffle memory between UMLs subject to the constraint that the host shouldn't
swap. So, whenever it looks like the host is running short of free memory,
it would remove some memory from a UML or two in order to alleviate the
shortage. I'm planning on shipping such a script when I think this stuff works.
Jeff
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2003-12-08 18:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-08 16:39 [uml-devel] [PATCH] Locking user-mode kernel RAM into host physical RAM Matthew Bloch
2003-12-08 17:31 ` Matt Ayres
2003-12-08 18:02 ` Steven Pritchard
2003-12-08 18:57 ` [uml-devel] Re: chroot option Henrik Nordstrom
2003-12-08 22:04 ` Jeff Dike
2003-12-08 23:00 ` Henrik Nordstrom
2003-12-08 19:01 ` Jeff Dike [this message]
2003-12-08 22:23 ` [uml-devel] [PATCH] Locking user-mode kernel RAM into host physical RAM Matthew Bloch
2003-12-08 23:18 ` Henrik Nordstrom
2003-12-09 0:14 ` Matthew Bloch
2003-12-09 19:00 ` 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=200312081901.hB8J1VAv028738@ccure.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=matthew-list@bytemark.co.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox