From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlJ5c-0006hy-Fk for qemu-devel@nongnu.org; Tue, 26 Nov 2013 08:54:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlJ5T-0005IT-3c for qemu-devel@nongnu.org; Tue, 26 Nov 2013 08:54:08 -0500 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:46151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlJ5S-0005I6-G4 for qemu-devel@nongnu.org; Tue, 26 Nov 2013 08:53:59 -0500 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Nov 2013 19:23:55 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 1928F3940058 for ; Tue, 26 Nov 2013 19:23:53 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rAQDrm1k32636934 for ; Tue, 26 Nov 2013 19:23:49 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rAQDrpkv003099 for ; Tue, 26 Nov 2013 19:23:51 +0530 Message-ID: <5294A7EC.4060501@linux.vnet.ibm.com> Date: Tue, 26 Nov 2013 21:53:48 +0800 From: Lei Li MIME-Version: 1.0 References: <1385025100-3191-1-git-send-email-lilei@linux.vnet.ibm.com> <1385025100-3191-17-git-send-email-lilei@linux.vnet.ibm.com> <529486B5.90500@redhat.com> <52948E18.6070503@linux.vnet.ibm.com> <52949A19.1010307@redhat.com> In-Reply-To: <52949A19.1010307@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 16/17] migration: adjust migration_thread() process for page flipping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aarcange@redhat.com, quintela@redhat.com, mdroth@linux.vnet.ibm.com, mrhines@linux.vnet.ibm.com, qemu-devel@nongnu.org, aliguori@amazon.com, lagarcia@br.ibm.com, rcj@linux.vnet.ibm.com On 11/26/2013 08:54 PM, Paolo Bonzini wrote: > Il 26/11/2013 13:03, Lei Li ha scritto: >>>> + if (pending_size && pending_size >= max_size && >>>> + !runstate_needs_reset()) { >>>> qemu_savevm_state_iterate(s->file); >>> I'm not sure why you need this. >> The adjustment here is to avoid the iteration stage for page flipping. >> Because pending_size = ram_save_remaining() * TARGET_PAGE_SIZE which is >> not 0 and pending_size > max_size (0) at start. > It's still not clear to me that avoiding the iteration stage is The purpose of it is not just for optimization, but to avoid the iteration for better alignment. The current flow of page flipping basically has two stages: 1) ram_save_setup stage, it will send all the bytes in this stages to destination, and send_pipefd by ram_control_before_iterate at the end of it. 2) ram_save_complete, it will start to transmit the ram page in ram_save_block, and send the device state after that. So it needs to adjust the current migration process to avoid the iteration stage. > necessary. I think it's just an optimization to avoid scanning the > bitmap, but: > > (1) Juan's bitmap optimization will make this mostly unnecessary > > (2) getting good downtime from page flipping will require postcopy anyway. > >> And you said 'This is a bit ugly but I understand the need. Perhaps "&& >> !runstate_needs_reset()" like below?' :) > Oops. I might have said this before thinking about postcopy and/or > before seeing the benchmark results from Juan's patches. If this part > of the patch is just an optimization, I'd rather leave it out for now. I am afraid that page flipping can not proceed correctly without this.. > > Thanks for putting up with me. :) > > Paolo > -- Lei