From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v2] xen: arm32: reduce default size of the xenheap Date: Thu, 5 Feb 2015 15:34:31 +0000 Message-ID: <1423150471.32563.4.camel@citrix.com> References: <1423133529-30049-1-git-send-email-ian.campbell@citrix.com> <54D377B8.4090800@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54D377B8.4090800@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, Jintack Lim , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2015-02-05 at 22:01 +0800, Julien Grall wrote: > If the user requests a xenheap of 0MB, we will use the default size, > right? It may be worth to explain this case. I think it's pretty generally understood that 0 generally means the default, unless otherwise specified. > Also with the algorithm to find a range, the Xen heap may be smaller. I > would explain that too. True. > > + xenheap_pages = opt_xenheap_megabytes << (20-PAGE_SHIFT); > > + else > > + { > > + xenheap_pages = (heap_pages/32 + 0x1fffUL) & ~0x1fffUL; > > + xenheap_pages = max(xenheap_pages, 32UL<<(20-PAGE_SHIFT)); > > + xenheap_pages = min(xenheap_pages, 1UL<<(30-PAGE_SHIFT)); > > + } > > do > > { > > You seem to have forgotten to update the condition in the do/while: > > xenheap_pages > 128 << (20 - PAGE_SHIFT); Seems like I need to refactor this number into a constant somewhere. Ian.