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: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] confusion over memory, maxmem, balloon, etc
From: Daniel Goertzen <goertzen@xxxxxxxx>
Date: Sat, 21 Jan 2006 16:36:07 -0600
Delivery-date: Sat, 21 Jan 2006 22:43:33 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43D28319.8020801@xxxxxxx>
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>
References: <43D2752B.9030004@xxxxxxxx> <43D28319.8020801@xxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
Thank you Jeffrey, that was a huge help. I have some device driver work under my belt so that all made perfect sense.

I assume that the balloons are entirely under manual control at the moment, ie, you can't get domains to pump up their balloons when nothing is going on?

Cheers,
Dan.

Jeffrey I. Schiller wrote:

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 :-)




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

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