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] linux/balloon: prefer using pages from balloon i

To: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] linux/balloon: prefer using pages from balloon in alloc_empty_pages_and_pagevec()
From: Dave McCracken <dcm@xxxxxxxx>
Date: Thu, 17 Dec 2009 14:33:04 -0600
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 17 Dec 2009 12:33:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4B290BA3020000780002648D@xxxxxxxxxxxxxxxxxx>
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: <4B2907320200007800026472@xxxxxxxxxxxxxxxxxx> <4B290BA3020000780002648D@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.12.4 (Linux/2.6.28; KDE/4.3.4; x86_64; ; )
On Wednesday 16 December 2009, Jan Beulich wrote:
> ... which seems to be broken at present anyway: The main loops in
> {alloc,free}_empty_pages_and_pagevec() both did not get their
> upper bound updated correctly (should be npages, but was left to
> be nr_pages), for alloc_empty_pages_and_pagevec() the wrong value
> is also being used to allocate pagevec[] (though I really think that this
> shouldn't allocate more than a nr_pages vector to avoid a rather large
> but unnecessary kmalloc() when nr_pages is small), and in its error
> path only a single page gets freed (rather than the whole
> balloon_order chunk).

You are correct.  The endpoint of the main loops should be npages, as should 
the variable used in the kmalloc().

I could only allocate the pagevec to be nr_pages and just fill it in with the 
partial order 9 page rather than rounding it up.  I'll ponder that.

I don't see anything wrong with the error path.  It correctly walks back down 
the pagevec and frees all the pages it's allocated so far.

Dave McCracken
Oracle Corp.

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