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

Re: [Xen-users] confusion over memory, maxmem, balloon, etc

To: Daniel Goertzen <goertzen@xxxxxxxx>
Subject: Re: [Xen-users] confusion over memory, maxmem, balloon, etc
From: "Jeffrey I. Schiller" <jis@xxxxxxx>
Date: Sat, 21 Jan 2006 13:53:13 -0500
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 21 Jan 2006 19:02:17 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43D2752B.9030004@xxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Openpgp: id=F414952B
Organization: Massachusetts Institute of Technology
References: <43D2752B.9030004@xxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Debian Thunderbird 1.0.2 (X11/20050331)
I won't answer all of your questions, but I'll tell you this.

The memory parameter establishes the amount of member that domU believes
it has. From what I can tell, once you boot domU it cannot use more
memory then this (because this is all that the domU kernel knows about).

Let's say you set this to 512Mb so your domU kernel is using 512Mb.
Suppose you want 128Mb back. Using the “xm” command in dom0 (in 2.0.7 it
is the “balloon” subcommand and in 3.0 I believe it is “maxmem” [I'm not
100% on this because I don't have the documentation handy, if you
attempt to use “xm balloon” in 3.0 it will tell you the new command
name!]) set the domain's memory to 384Mb (512-128). What happens is that
dom0 tells the domU's kernel to reduce its memory usage. It does this my
kmem alloc'ing 128Mb of memory (so the domU kernel thinks it is using
this memory) and then handing the physical memory back to the
hypervisor. So as far as the linux kernel is concerned in domU, there is
this 128Mb “balloon” of memory that it cannot touch. In fact it isn't
there [and I suspect attempting to touch it will cause a fault].

When you give back the memory to domU, the balloon driver requests the
memory from the hypervisor to fill in the balloon and then kmem free's
it. This makes it available again to domU.

This all works the same way in dom0.

So you can hand memory from dom0 to domU and back again...

Hope this helps.

                        -Jeff

P.S. I am not a Xen developer, just a user [of 2.0.7 at the moment,
playing with 3.0] who has read some source code :-)

-- 
=============================================================================
Jeffrey I. Schiller
MIT Network Manager
Information Services and Technology
Massachusetts Institute of Technology
77 Massachusetts Avenue  Room W92-190
Cambridge, MA 02139-4307
617.253.0161 - Voice
jis@xxxxxxx
============================================================================

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>