WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [XEN] using shmfs for swapspace

To: linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxx
Subject: [Xen-devel] [XEN] using shmfs for swapspace
From: Luke Kenneth Casson Leighton <lkcl@xxxxxxxx>
Date: Sun, 2 Jan 2005 16:26:52 +0000
Delivery-date: Sun, 02 Jan 2005 16:18:32 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.5.1+cvs20040105i
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>
--


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel