From: Tim Deegan Subject: Re: [PATCH 6 of 8 [RFC]] libxc: introduce xc_domain_move_memory Date: Thu, 2 May 2013 16:13:05 +0100 Message-ID: <20130502151305.GN65547@ocelot.phlegethon.org> References: <20130502143209.GL65547@ocelot.phlegethon.org> <51828122.7000900@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <51828122.7000900@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Dan Magenheimer , Ian Campbell , Andrew Cooper , Juergen Gross , Olaf Hering , xen-devel , David Vrabel , Keir Fraser , Andres Lagar-Cavilla , Jan Beulich , Dario Faggioli , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org At 16:07 +0100 on 02 May (1367510834), George Dunlap wrote: > On 02/05/13 15:32, Tim Deegan wrote: > >Hi, > > > >This looks like a promising start. Two thoughts: > > > >1. You currently move memory into a bufferm free it, allocate new memory > > and restore the contents. Copying directly from old to new would be > > significantly faster, and you could do it for _most_ batches: > > - copy old batch 0 to the backup buffer; free old batch 0; > > - allocate new batch 1; copy batch 1 directly; free old batch 1; > > ... > > - allocate new batch n; copy batch n directly; free old batch n; > > - allocate new batch 0; copy batch 0 from the backup buffer. > > Hmm -- isn't it the case that if there is not *free* memory lying around > somewhere, then this operation is fairly pointless? What will happen is > that after freeing batch 0, "allocate new batch 1" will get that > memory. So copying it to a temporary buffer in dom0 seems like not a > particularly useful thing to do -- it should try to allocate a new > buffer to copy into directly, and if that fails, just say "No point > trying -- no empty memory to move into." Sure, that's better, as long as the temporary bump in the VM's max_pages is acceptable to the rest of the toolstack. :) Tim.