From mboxrd@z Thu Jan 1 00:00:00 1970 From: Unknown Subject: Re: [PATCH 2/7] xen: avoid adding non-existant memory if the reservation is unlimited Date: Wed, 21 Sep 2011 11:08:58 -0400 Message-ID: <20110921150858.GE541@phenom.oracle.com> References: <1316089768-22461-1-git-send-email-david.vrabel@citrix.com> <1316089768-22461-3-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: From: Konrad Rzeszutek Content-Disposition: inline In-Reply-To: <1316089768-22461-3-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: David Vrabel Cc: xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Thu, Sep 15, 2011 at 01:29:23PM +0100, David Vrabel wrote: > From: David Vrabel > > 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 > --- > 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