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] Fix e820 mapping limit

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] Fix e820 mapping limit
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Tue, 12 Dec 2006 19:11:25 +0000
Delivery-date: Tue, 12 Dec 2006 11:11:23 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20061212182525.GC29123@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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20061212182525.GC29123@xxxxxxxxxx>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Tue, Dec 12, 2006 at 06:25:25PM +0000, Daniel P. Berrange wrote:
> The changeset '12803:df5fa63490f4da7b65c56087a68783dbcb7944f8' added a new
> hypercall XENMEM_set_memory_map for specifying the e820 mapping. There was
> a small bug in the userspace side of this change though - the e820 mapping
> was specified based on the 'memory_static_min' domain info parameter which
> means the memory map size is clamped to the value 'memory' config option.
> 
> What we actually want is to setup the e820 map limit based on 'maxmem'
> config option, so that we can balloon up the guest to its max limit.
> 
>  eg
>   If we boot with 'memory=400' and 'maxmem=800', the e820 map should be
>   set to 800 MB, and the guest should allocate  only 400 MB at startup.
>   It should then be possible to use 'xm mem-set' after boot to assgin
>   upto this 800 MB.
> 
> Thus, the attached patch fixed the image.py class to setup the e820 mapping
> based on 'memory_static_max' which is in turn based on 'maxmem'. Booting
> with this patch I can verify that the guest kernel sees a 800 MB e820 map,
> so this fixes the initial problem.
> 
> There appears to be a second issue somewhere in the stack though, because
> even if do 'xm mem-set <domid> 600', while the ballon driver in the guest
> will see the 600 MB target, it will still never try to allocate its 
> increased target.

Turns out this was a bug introduced in the refactoring of memory config
parameters from Xen API work. The memory & memmax parameters were getting
initialized the wrong way around. With this fixed & the e820 map fix, 
memory ballooning works perfectly:

  # xm create demo
  Using config file "/etc/xen/demo".
  Going to boot Fedora Core (2.6.18-1.2769.2.2.el5xen)
    kernel: /vmlinuz-2.6.18-1.2769.2.2.el5xen
    initrd: /initrd-2.6.18-1.2769.2.2.el5xen.img
  Started domain demo
  # xm list demo
  Name                                      ID   Mem VCPUs      State   Time(s)
  demo                                      16   410     2     -b----      0.4
  # xm mem-set demo 600
  # xm list demo
  Name                                      ID   Mem VCPUs      State   Time(s)
  demo                                      16   600     2     -b----      4.2


Attaching an updated patch which fixes both the memory ballooning issues
in one go

  Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

Attachment: xen-mem-e820-size-2.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>