From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlHN1-0006fU-Vq for qemu-devel@nongnu.org; Tue, 26 Nov 2013 07:04:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlHMt-0003yu-2P for qemu-devel@nongnu.org; Tue, 26 Nov 2013 07:03:59 -0500 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:59008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlHMs-0003yl-Do for qemu-devel@nongnu.org; Tue, 26 Nov 2013 07:03:50 -0500 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Nov 2013 17:33:44 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 76442E005B for ; Tue, 26 Nov 2013 17:35:46 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rAQC3bTr43253784 for ; Tue, 26 Nov 2013 17:33:37 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rAQC3dRM020015 for ; Tue, 26 Nov 2013 17:33:39 +0530 Message-ID: <52948E18.6070503@linux.vnet.ibm.com> Date: Tue, 26 Nov 2013 20:03:36 +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> In-Reply-To: <529486B5.90500@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, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, aliguori@amazon.com, lagarcia@br.ibm.com, rcj@linux.vnet.ibm.com On 11/26/2013 07:32 PM, Paolo Bonzini wrote: > Il 21/11/2013 10:11, Lei Li ha scritto: >> Signed-off-by: Lei Li >> --- >> migration.c | 10 +++++++--- >> 1 files changed, 7 insertions(+), 3 deletions(-) >> >> diff --git a/migration.c b/migration.c >> index 4ac466b..0f98ac1 100644 >> --- a/migration.c >> +++ b/migration.c >> @@ -579,10 +579,11 @@ static void *migration_thread(void *opaque) >> pending_size = qemu_savevm_state_pending(s->file, max_size); >> DPRINTF("pending size %" PRIu64 " max %" PRIu64 "\n", >> pending_size, max_size); >> - if (pending_size && pending_size >= max_size) { >> + 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. In the previous version it was like this: if (pending_size && pending_size >= max_size && !migrate_unix_page_flipping()) { And you said 'This is a bit ugly but I understand the need. Perhaps "&& !runstate_needs_reset()" like below?' :) > >> } else { >> - int ret; >> + int ret = 0; >> >> DPRINTF("done iterating\n"); >> qemu_mutex_lock_iothread(); >> @@ -590,7 +591,10 @@ static void *migration_thread(void *opaque) >> qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER); >> old_vm_running = runstate_is_running(); >> >> - ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); >> + if (!runstate_needs_reset()) { >> + ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); >> + } > This however is okay. > > Paolo > >> if (ret >= 0) { >> qemu_file_set_rate_limit(s->file, INT_MAX); >> qemu_savevm_state_complete(s->file); >> > -- Lei