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

[Xen-devel] Re: [PATCH 2/7] xen: avoid adding non-existant memory if the

To: David Vrabel <david.vrabel@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 2/7] xen: avoid adding non-existant memory if the reservation is unlimited
From: Konrad Rzeszutek <konrad@konrad-lan>
Date: Wed, 21 Sep 2011 11:08:58 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Thu, 22 Sep 2011 04:54:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1316089768-22461-3-git-send-email-david.vrabel@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>
References: <1316089768-22461-1-git-send-email-david.vrabel@xxxxxxxxxx> <1316089768-22461-3-git-send-email-david.vrabel@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Sep 15, 2011 at 01:29:23PM +0100, David Vrabel wrote:
> From: David Vrabel <david.vrabel@xxxxxxxxxx>
> 
> If the domain's reservation is unlimited, too many pages are added to
> the balloon memory region.  Correctly check the limit so the number of
> extra pages is not increased in this case.

and this one is in 3.1 too. Albeit with a more verbose description.
Look in git commit: e3b73c4a25e9a5705b4ef28b91676caf01f9bc9f

> 
> Signed-off-by: David Vrabel <david.vrabel@xxxxxxxxxx>
> ---
>  arch/x86/xen/setup.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index c3b8d44..46d6d21 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -306,10 +306,12 @@ char * __init xen_memory_setup(void)
>       sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
>  
>       extra_limit = xen_get_max_pages();
> -     if (extra_limit >= max_pfn)
> -             extra_pages = extra_limit - max_pfn;
> -     else
> -             extra_pages = 0;
> +     if (max_pfn + extra_pages > extra_limit) {
> +             if (extra_limit > max_pfn)
> +                     extra_pages = extra_limit - max_pfn;
> +             else
> +                     extra_pages = 0;
> +     }
>  
>       extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, 
> &e820);
>  
> -- 
> 1.7.2.5

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