From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: linux-kernel@vger.kernel.org, xen-devel@lists.sf.net
Subject: [XEN] using shmfs for swapspace
Date: Sun, 2 Jan 2005 16:26:52 +0000 [thread overview]
Message-ID: <20050102162652.GA12268@lkcl.net> (raw)
hi,
am starting to play with XEN - the virtualisation project
(http://xen.sf.net).
i'll give some background first of all and then the question - at the
bottom - will make sense [when posting to lkml i often get questions
asked that are answered by the background material i also provide...
*sigh*]
each virtual machine requires (typically) its own physical ram (a chunk
of the host's real memory) and some virtual memory - swapspace. xen
uses 32mb for its shm guest OS inter-communication.
so, in the case i'm setting up, that's 5 virtual machines (only one of
which can get away with having only 32mb of ram, the rest require 64mb)
so that's five lots of 256mbyte swap files.
the memory usage is the major concern: i only have 256mb of ram and
you've probably by now added up that the above comes to 320mbytes.
so i started looking at ways to minimise the memory usage.
first, reducing each machine to only having 32mb of ram, and secondly,
on the host, creating a MASSIVE swap file (1gbyte), making a MASSIVE
shmfs/tmpfs partition (1gbyte) and then creating swap files in the
tmpfs partition!!!
the reasoning behind doing this is quite straightforward: by placing the
swapfiles in a tmpfs, presumably then when one of the guest OSes
requires some memory, then RAM on the host OS will be used until such
time as the amount of RAM requested exceeds the host OSes physical
memory, and then it will go into swap-space.
this is presumed to be infinitely better than forcing the swapspace to
be always on disk, especially with the guests only being allocated
32mbyte of physical RAM.
here's the problems:
1) tmpfs doesn't support sparse files
2) files created in tmpfs don't support block devices (???)
3) as a workaround i have to create a swap partition in a 256mb file,
(dd if=/dev/zero of=/mnt/swapfile bs=1M count=256 and do mkswap on it)
then copy the ENTIRE file into the tmpfs-mounted partition.
on every boot-up.
per swapfile needed.
eeeuw, yuk.
so, my question is a strategic one:
* in what other ways could the same results be achieved?
in other words, what other ways can i publish block
devices from the master OS (and they must be block
devices for XEN guest OSes to be able to see them)
that can be used as swap space, that will be in RAM if possible,
bearing in mind that they can be recreated at boot time,
i.e. they don't need to be persistent.
ta,
l.
--
--
<a href="http://lkcl.net">http://lkcl.net</a>
--
next reply other threads:[~2005-01-02 16:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-02 16:26 Luke Kenneth Casson Leighton [this message]
2005-01-03 18:31 ` [XEN] using shmfs for swapspace Joseph Fannin
2005-01-03 20:53 ` Luke Kenneth Casson Leighton
2005-01-03 21:06 ` Alan Cox
2005-01-04 3:04 ` [Xen-devel] " Mark Williamson
2005-01-04 14:05 ` Rik van Riel
2005-01-06 11:38 ` Luke Kenneth Casson Leighton
2005-01-05 0:11 ` Arnd Bergmann
2005-01-21 21:37 ` Rik van Riel
2005-01-26 20:56 ` Mark Williamson
2005-01-27 10:33 ` Nuutti Kotivuori
2005-01-03 21:07 ` Adam Heath
2005-01-04 9:30 ` Luke Kenneth Casson Leighton
2005-01-04 14:06 ` Rik van Riel
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=20050102162652.GA12268@lkcl.net \
--to=lkcl@lkcl.net \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.sf.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