From: Ian Campbell Subject: Re: [PATCH v2 3/8] tools: arm: allocate large pages to guests. Date: Thu, 12 Jun 2014 08:19:32 +0100 Message-ID: <1402557572.31087.53.camel@dagon.hellion.org.uk> References: <1402504640.16332.50.camel@kazak.uk.xensource.com> <1402504804-29173-3-git-send-email-ian.campbell@citrix.com> <5398C9A1.1000701@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5398C9A1.1000701@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, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-06-11 at 22:26 +0100, Julien Grall wrote: > Hi Ian, > > On 11/06/14 17:39, Ian Campbell wrote: > > Previously we would allocate in batches of up to 4GB worth of pages (allocsz > > clamped at 1024*1024 pages) however this would now require 8MB worth of start > > for the extents array in populate_one_size. Reduce to just 256*1024 or 1GB > > worth of pages (at level 3) or 2MB of stack. > > I think you can drop this paragraph. You are using calloc rather than > the stack in your patch. Oops, yes. I'll do that on commit unless I have another reason to resend. > > - return rc; > > + for ( pfn = 0; pfn < nr_pfns; pfn++ ) > > + dom->p2m_host[pfn] = base_pfn + pfn; > > + > > +out: > > + free(extents); > > Does free preserve errno? I can't find anything saying it... If so we > may lose it when there is not enought memory. I'm not 100% sure but I'm almost certain it is fine. free() returns void and http://pubs.opengroup.org/onlinepubs/007908799/xsh/free.html says no error codes are defined for it. We don't preserve errno in numerous error paths. Ian.