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] Balloon Driver Documentation/Description

To: Timo Benk <timo.benk@xxxxxx>
Subject: Re: [Xen-users] Balloon Driver Documentation/Description
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Fri, 13 Oct 2006 02:05:40 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 12 Oct 2006 18:06:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <452B3F65.10801@xxxxxx>
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: <4527F31C.4080609@xxxxxxxxxxxxx> <200610091808.36062.mark.williamson@xxxxxxxxxxxx> <452B3F65.10801@xxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.1
> That is my understanding of the balloon driver. What i do not understand
> is, if the balloon driver consists just of a frontend part in DomU that
> is allocating some memory, and a backend driver in Dom0, that gives that
> memory back, why is the output of the free command correct?
>
> What i want to say is the following:
>
> xendom1:~ # free
>              total       used       free
> Mem:        786432     117104     669328
>
> xendom1:~ # echo -n "536870912" > /proc/xen/balloon
>
> xendom1:~ # free
>              total       used       free
> Mem:        524288     116664     407624
>
> Why is the total amount of RAM also changing. If the balloon driver just
> allocates the memory, the used value should raise, but the total value
> should stay.

Ooooooh.  I don't think it used to do this, so presumably it's got cleverer 
since I last tried it out.

> I am not a kernel hacker, but i think i need to take a look into the
> code to understand that.

Look for references to totalram_pages

proc_misc::meminfo_read_proc() is responsible for generating the output 
of /proc/meminfo, which in turn is used by free.  The total amount of ram is 
determined by the value in totalram_pages, which gets updated by the balloon 
driver.

Hence the value of free is updated correctly, even though behind the scenes 
the ballooon driver works by allocating memory and giving it to Xen.  It just 
hides this implementation detail from the user, AFAIK.

HTH,
Cheers,
Mark

-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

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

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