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] Disallow setting maxmem to higher value than tot

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Disallow setting maxmem to higher value than total physical memory size
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 01 Sep 2010 14:10:21 -0700
Cc: Michal Novotny <minovotn@xxxxxxxxxx>, "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 01 Sep 2010 14:27:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1283367212.3469.136.camel@xxxxxxxxxxxxxxxxxxxxx>
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>
References: <4C7E47B2.9010805@xxxxxxxxxx> <1283345049.12544.9494.camel@xxxxxxxxxxxxxxxxxxxxxx> <4C7E8523.2080108@xxxxxxxx> <1283363785.3469.104.camel@xxxxxxxxxxxxxxxxxxxxx> <4C7E9833.4070106@xxxxxxxx> <1283367212.3469.136.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Lightning/1.0b2pre Thunderbird/3.1.2
 On 09/01/2010 11:53 AM, Ian Campbell wrote:
> On Wed, 2010-09-01 at 19:15 +0100, Jeremy Fitzhardinge wrote:
>> On 09/01/2010 10:56 AM, Ian Campbell wrote:
>>> On Wed, 2010-09-01 at 17:53 +0100, Jeremy Fitzhardinge wrote:
>>>> On 09/01/2010 05:44 AM, Ian Campbell wrote:
>>>>> On Wed, 2010-09-01 at 13:31 +0100, Michal Novotny wrote:
>>>>>> Hi,
>>>>>> this is the patch to disallow changing the maxmem value to higher value 
>>>>>> than total physical memory size since without this patch I was able to 
>>>>>> set dom0 maxmem to higher (invalid) value which is not correct.
>>>>> I think it is allowable for a domU though. Consider the scenario where
>>>>> you have two hosts, one of which has more physical RAM than the other.
>>>>> You may which to boot a domain on the smaller host, (i.e. booting
>>>>> ballooned with a current_pages suitable for the small host) and then
>>>>> migrate it to the large machine where you then want to be able to
>>>>> balloon to a value larger than was even possible on the previous
>>>>> machine.
>>>> But max-mem can change between hosts; on the small host it needn't have
>>>> a maxmem larger than the host's memory.  (The domain itself may have a
>>>> larger notion of maxmem internally, but that's separate.)
>>> It's not separate, this guest configuration item precisely informs the
>>> guest how large it can expect it's memory map to ever need to be (the
>>> setting is also called the static-max in both xend and xapi).
>> No, that is separate.  There are three values:
>>
>>    1. the domain's initial memory allocation
>>    2. the max size the domain will ever grow to
>>    3. the max size Xen will allow the domain to grow to right now
>>
>> At domain build time, the domain needs to know 1 and 2, but 3 is
>> irrelevant (so long it is larger than 1). 
>>
>> 2 can be arbitrarily large.  The domain may not need to know about 2 at
>> all if it can dynamically add memory at runtime via, say, memory
>> hotplug.  It only matters if it needs to statically allocate space in
>> its memory map for future balloonings.
> Yes, so it only matters for all PV Linux guests which currently support
> ballooning up from their initial size...

Yes,  but it doesn't relate to 3, is my point.  It only matters at the
moment of domain creation.

>> There's no need for 3 to ever be larger than the host's physical memory,
>> and it can be changed at will (if the host memory size changes due to
>> hotplug memory, save/restore or migrate).
>>
>> AFAICT, "static-max" is completely useless, at least for PV Linux
>> domains, because the kernel needs to get that value when its
>> constructing its basic memory mappings, way before it has any chance to
>> talk to xenstore.
> It's not only in xenstore, it is also in the result of the
> XENMEM_get_memory_map hypercall.

Is that separate from 3?

> Old-style PV Linux domains really do use static-max in this way. It may
> well be that there are potentially better ways for guests to implement
> this in the future but we have a deployed base of guests which work this
> way.

I specifically meant the Xenstore "static-max" value is useless. 
Getting it via hypercall is fine.

>>> For a PV guest the value is pushed down into the hypervisor by the
>>> toolstack via XENMEM_set_memory_map and this controls the memory map
>>> returned to the guest from XENMEM_get_memory_map, which in turn informs
>>> the guest's choice of maxmem value (for PV guests which can boot
>>> ballooned that is).
>> OK, I need to investigate that.  But the maxmem size for the domain
>> should be something derived from the domain's config file,
> I thought we were talking about clamping the value from the domain's
> config file, weren't we? At least that's what I thought the proposed
> patch would end up doing, which is why I was objecting.

Oh, if that's the case, then sure, don't clamp that.

    J

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

<Prev in Thread] Current Thread [Next in Thread>