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

Re: [Xen-devel] how mem-set / balloon changes totalram_pages

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] how mem-set / balloon changes totalram_pages
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Sun, 2 Dec 2007 04:33:46 +0000
Cc: weiming <zephyr.zhao@xxxxxxxxx>
Delivery-date: Sat, 01 Dec 2007 20:34:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <add59a3f0711151941o72afd912l73d79877a06e31cf@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <add59a3f0711151941o72afd912l73d79877a06e31cf@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)
> I find that after I use xm mem-set to change the current memory
> allocation of a dom, the MemTotal in /proc/meminfo will give the
> current allocation.
>
> In my understanding, the balloon driver simply alloc / free pages, so
> the MemTotal should not be changed. Only the free memory will be
> affected.
>
> In normal linux, the value of MemTotal comes from "totalram_pages"
> defined in arch/i386/mm/init.c
>
> I tried to located the code in Xen, which changes the variable, but I
> didn't find such code.

This variable is updated by the balloon driver in XenLinux 
(drivers/xen/balloon/balloon.c).  totalram_pages is declared as an extern 
there - when the balloon changes size, totalram_pages is updated accordingly.

> I tried to locate the implementation of  HYPERCALL_memory_op, but I
> can only traced to
> "call hypercall_page + STR(...)"
>
> Can someone tell me where I can find the actual implementation of
> those hypercalls?

Well, the code you found implements the call into Xen.  It gets handled 
eventually by do_memory_op in xen/common/memory.c under the Xen repository.  
This implements the memory ops and then returns to the guest (and thence to 
the balloon driver).

Hope that helps,

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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-devel] how mem-set / balloon changes totalram_pages, Mark Williamson <=