From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave McCracken Subject: Re: [PATCH] linux/balloon: prefer using pages from balloon in alloc_empty_pages_and_pagevec() Date: Thu, 17 Dec 2009 14:33:04 -0600 Message-ID: <200912171433.04459.dcm@mccr.org> References: <4B2907320200007800026472@vpn.id2.novell.com> <4B290BA3020000780002648D@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4B290BA3020000780002648D@vpn.id2.novell.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: Jan Beulich Cc: Jeremy Fitzhardinge , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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.