[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] How much memory does a domain REALLY use...


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Graham, Simon" <Simon.Graham@xxxxxxxxxxx>
  • Date: Fri, 23 Feb 2007 20:21:51 -0500
  • Delivery-date: Fri, 23 Feb 2007 17:21:08 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcdXsilmiwy4S98FTPqiaqV0JXsxkg==
  • Thread-topic: How much memory does a domain REALLY use...

Apologies if this has been discussed before, but I've been trying to
work out just how much memory domains consume (so as to be able to
provision memory properly) - this all started when I noticed that a
system running JUST my 768MB Dom0 was actually using about 890MB
according to xenstat - an extra 122MB seemed a little extreme to me so I
went digging; I think I've found something over half so far but I'm not
sure about the remaining so I was hoping folks could educate me...

Here's what I think I've found (all this is i386, 32-bit PAE...):

First, from the domain/dma heap zones, in addition to the actual domain
memory allocated with alloc_chunk() in 2MB pieces:

. First, the biggie -- swiotlb; if I'm not mistaken, this allocates 64MB
from the domain
  heap (in addition to the 64MB of low memory in the domain itself).
Allocated with
  xen_create_contiguous_region in 256KB chunks.
. paging_init() allocates the m2p translation table -- 2MB
. The Linux dma_alloc_coherent() routine also calls
xen_create_contiguous_region -- each call
  to this routine will allocate a minimum of one page from the domain
heap -- every single
  driver that does DMA will do this, so there is the possibility of some
significant
  allocations due to DMA buffers. I'm wondering if this comprises the
remainder of the
  122MB I see...
. There are a few other single page allocations but nothing huge

Then, from the Xen heap zone a bunch of small stuff:

. 128KB for console debug trace (debugtrace_init)
. 16KB for serial tx buffer
. 16KB for page directory pages (arch_domain_create)
. 16KB for stack per VCPU (do_boot_cpu in smpboot)
. 16KB per grant table (one per domain - _grant_table_create)
. 4KB for grant table references (can grow to 128KB -
__gnttab_map_grant_ref)
. max of 128KB for xenoprofile buffer space - presumably zero until I
actually
  start profiling.

So - I've found about 69MB for sure, plus an unknown quantity of DMA
common buffer allocations - still seems a bit shy of the 122MB I see...
all thoughts welcome...

Thanks,
Simon


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.