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] [PATCH] x86: use 'dom0_mem' to limit the number of pages

To: David Vrabel <david.vrabel@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] x86: use 'dom0_mem' to limit the number of pages for dom0
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Tue, 16 Aug 2011 13:51:56 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Tue, 16 Aug 2011 05:52:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E4A62B9.4030302@xxxxxxxxxx>
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>
Organization: Citrix Systems, Inc.
References: <1ec6c392d40f37032b0c.1313431713@qabil> <20110816003158.GA26540@xxxxxxxxxxxx> <4E4A62B9.4030302@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2011-08-16 at 13:29 +0100, David Vrabel wrote:
> On 16/08/11 01:31, Konrad Rzeszutek Wilk wrote:
> > On Mon, Aug 15, 2011 at 07:08:33PM +0100, David Vrabel wrote:
> >> x86: use 'dom0_mem' to limit the number of pages for dom0
> >>
> >> Use the 'dom0_mem' command line option to set the maximum number of
> >> pages for dom0.  dom0 can use then use the XENMEM_maximum_reservation
> >> memory op to automatically find this limit and reduce the size of any
> >> page tables etc.
> > 
> > So .. I was actually curious about this -how did this use to work
> > with 2.6.18? In there, if you did 'dom0_mem=max:2GB' it would limit the
> > amount of memory - so how does it do that?
> 
> I don't know. I've not really looked at how the older kernels did it.

The classic-Xen kernels didn't try and munge the pseudo-physical (i.e.
RAM) address map with the machine (i.e. I/O) address map together in the
way pvops does, they just treated them as two orthogonal address spaces
(which has it's own issues, /proc/iomem is a complete fiction for
example). They don't really suffer from the same issues wrt e.g.
tracking where the I/O hole was before you clipped the initial amount of
RAM and all that.

The key difference is that classic-Xen kernels called both
XENMEM_memory_map and XENMEM_machine_memory_map and dealt with both,
whereas pvops (dom0) calls XENMEM_machine_memory_map and tries to figure
out how much of the E820_RAM therein it can actually use based on
nr_pages and such. You've used XENMEM_maximum_reservation in your
followup series which I think is a suitable surrogate for calling
XENMEM_memory_map (although I didn't check).

The linkage between mm setup and balloon driver setup in the classic
kernels was more explicit too IIRC.

> >> diff -r 8d6edc3d26d2 -r 1ec6c392d40f xen/arch/x86/domain_build.c
> >> --- a/xen/arch/x86/domain_build.c  Sat Aug 13 10:14:58 2011 +0100
> >> +++ b/xen/arch/x86/domain_build.c  Mon Aug 15 11:42:37 2011 +0100
> >> @@ -254,6 +254,8 @@ static unsigned long __init compute_dom0
> >>      }
> >>  #endif
> >>  
> >> +    d->max_pages = min(max_pages, avail);
> >> +
> > 
> > don't you need the amount of p2m as well? Or is that all limited
> > by d->max_pages?
> 
> Do you mean the initial p2m supplied by Xen?  I think that just covers
> the initial pages.

I think so too.

> The p2m structure maintained by the kernel appears to be dynamically
> allocated based on what mappings are required.

IIRC it is expanded around start of day to cover the start of day max
mappings etc (using BRK space) and further expanded later on
dynamically.

> 
> David
> 
> _______________________________________________
> 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