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] hypervisor memory usage

To: Vladimir Zidar <mr_w@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] hypervisor memory usage
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Wed, 28 Oct 2009 10:40:54 +0000
Cc:
Delivery-date: Wed, 28 Oct 2009 03:55:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4AE814AF.3020800@xxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcpXtKOL5VDgXZG6S1mUoXsGyeaW9QABnxlV
Thread-topic: [Xen-devel] hypervisor memory usage
User-agent: Microsoft-Entourage/12.20.0.090605
By default Xen leaves 1/16 of memory free, up to a maximum of 128MB, for
things like allocation of DMA buffers and swiotlb, and other domains,
during/after dom0 boot. So you can see this memory is not actually all used,
but is in Xen free pools, by looking at output of 'xm info' after dom0 has
booted.

If you want dom0 to be given all available memory, add something like
'dom0_mem=64G' to Xen's command line. This overrides the default policy, and
a really large number like 64GB will get clamped down to merely "all memory
available".

 -- Keir

On 28/10/2009 09:53, "Vladimir Zidar" <mr_w@xxxxxxxxxxxxx> wrote:

>  What bothers me with this issue is that memory is 'lost' just after
> boot, without any of domUs running.
> 
>  Also, 8kb per 1MB would add up to 64MB per 8GB of ram, then I add 1
> more MB for dom0 (when counted as guest).
> 
>  Global hypervisor memory, that is question now, can it use 384MB
> straight after boot? - memory loss is detected at very first lines of
> dom0 dmesg.
> 
>  Is there a way to show more xen debugging before dom0 kicks in?
> 
> Pasi Kärkkäinen wrote:
>> On Wed, Oct 28, 2009 at 10:29:37AM +0100, Vladimir Zidar wrote:
>>   
>>> Hi,
>>> 
>>>  ** I sent this mail originally to xen-users, but after seeing other
>>> subjects posted on that list I felt that it was kind of wrong place to
>>> ask **
>>> 
>>> 
>>> I'm wondering why hypervisor itself uses so much memory? Is it normal?
>>> 
>>> I have several servers with 8GB of ram, all of them running x86_64
>>> centos 5.4 (latest) and when running under xen, dom0 has
>>> [root@palmae ~]# head -4 /proc/meminfo
>>> MemTotal:      7661568 kB
>>> MemFree:       6550044 kB
>>> Buffers:         37400 kB
>>> Cached:         303480 kB
>>> 
>>> Which is  440MB less than what I get without xen.
>>> It comes down to what amount of memory kernel gets either from Xen or
>>> from BIOS. Please note the differences:
>>> 
>>>     
>> 
>> First of all you should limit the amount of memory visible to dom0 by
>> specifying dom0_mem=512M (or so) parameter for xen.gz in grub.conf.
>> 
>> After that reboot and then you can check the Xen hypervisor free memory with
>> "xm info" and list the guest/domain mem usage with "xm list".
>> 
>> Xen has some memory overhead (just like every virtualization solution).
>> 
>> I think the formula for Xen memory overhead is: 8kB per 1MB of guest
>> memory, plus 1MB per guest virtual cpu.
>> 
>> I think this also applies to dom0, since basicly it is just a guest
>> (with some more privileges).
>> 
>> And in addition of course there is the "global" hypervisor memory
>> usage.. not sure if those will add up to 440 MB though.
>> 
>> -- Pasi
>> 
>>   
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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