HVM and free_memory query
Hello All
I have tried the xen-users list for this query but haven't received any input there yet so trying here. I have an Intel Xeon server with 32G memory. My setup is xen-3.2.2 with 32-bit CentOS 5.1 dom0 with a 64-bit hypervisor.
Initial state...
#xm info
<snip>
release : 2.6.18.8-xen0
version : #1 Thu Jun 18 14:06:08 PDT 2009
machine : i686nr_cpus : 8nr_nodes : 1cores_per_socket : 4threads_per_core : 1cpu_mhz : 1861hw_caps : bfebfbff:20100800:00000000:00000140:0004e3bd:00000000:00000001total_memory : 32766free_memory : 31298node_to_cpu : node0:0-7xen_major : 3xen_minor : 2xen_extra : .2-rc3-prexen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64xen_scheduler : creditxen_pagesize : 4096platform_params : virt_start=0xfdc00000
</snip>
#xm list
Name ID Mem VCPUs State Time(s) Domain-0 0 512 1 r----- 25216.9 controller 1 512 1 r----- 39912.5
After I create a Windows 2003 Server VM with 30G RAM...
#xm info
<snip>total_memory : 32766free_memory : 337
</snip>
#xm list
Name ID Mem VCPUs State Time(s) Domain-0 0 512 1 r----- 25251.4 controller 1 512 1 -b---- 39948.6
vm.windows03 44 30720 1 r----- 22.0
As you can see, the free_memory shown is 337M which is a good 241M less than what it should have been (31298M - 30720M = 578M) after the Windows VM was created. My question here is where/why does xen use that extra 241M. Any pointers much appreciated.
TIA!
-- Apoorva Kulkarni 3Tera, Inc.
Quoted 11 lines · Apoorva Kulkarni
#xm list
Name ID Mem VCPUs State
Time(s)Domain-0 0 512 1 r----- 25251.4 controller 1 512 1 -b---- 39948.6 vm.windows03 44 30720 1 r----- 22.0As you can see, the
free_memoryshown is 337M which is a good 241M less than what it should have been (31298M - 30720M = 578M) after the Windows VM was created. My question here is where/why does xen use that extra 241M. Any pointers much appreciated.
It's used for shadow pagetables and other memory book-keeping structures. This reservation is sized as a fraction of the domain's configured memory allocation -- the fraction is just under 0.8%. And 0.8% of 30720MB is 245MB, so that works out just about right.
This is one of those cases where a small fraction of a very big number is still a big number. ;-)
-- Keir
Quoted 9 lines · Keir Fraser
It's used for shadow pagetables and other memory book-keeping structures. This reservation is sized as a fraction of the domain's configured memory allocation -- the fraction is just under 0.8%. And 0.8% of 30720MB is 245MB, so that works out just about right.
This is one of those cases where a small fraction of a very big number is still a big number. ;-)
-- Keir
Keir
Thank you for your quick response. That helps a lot.
In our case we need to know precisely how much overhead memory is required by xen per domain. So is it okay for us to assume that it will always be under 0.8% or could there be exceptions to this (e.g. different fractions for a Solaris 10 HVM vs Windows HVM) ?
Thanks again.
--
Apoorva Kulkarni
3Tera, Inc.
Quoted 6 lines · Apoorva Kulkarni
Thank you for your quick response. That helps a lot.
In our case we need to know precisely how much overhead memory is required by xen per domain. So is it okay for us to assume that it will always be under 0.8% or could there be exceptions to this (e.g. different fractions for a Solaris 10 HVM vs Windows HVM) ?
Precisely, the overhead is determined by xend as: 8kB per 1MB of guest memory, plus 1MB per guest virtual cpu.
See xen/xend/image.py:X86_HVM_ImageHandler:getRequiredShadowMemory()
-- Keir
Quoted 11 lines · Keir Fraser
Quoted 7 lines · Apoorva Kulkarni
Thank you for your quick response. That helps a lot.
In our case we need to know precisely how much overhead memory is required by xen per domain. So is it okay for us to assume that it will always be under 0.8% or could there be exceptions to this (e.g. different fractions for a Solaris 10 HVM vs Windows HVM) ?
Quoted 7 lines
Precisely, the overhead is determined by xend as: 8kB per 1MB of guest memory, plus 1MB per guest virtual cpu.
See xen/xend/image.py:X86_HVM_ImageHandler:getRequiredShadowMemory()
-- Keir
Exactly what we were looking for. Thanks a ton.
--
Apoorva Kulkarni
3Tera, Inc.