From patchwork Thu Jun 28 19:22:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 167948 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 94BE2B7005 for ; Fri, 29 Jun 2012 05:24:21 +1000 (EST) Received: from localhost ([::1]:39925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkKKB-0003CT-DH for incoming@patchwork.ozlabs.org; Thu, 28 Jun 2012 15:24:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkKIQ-0007bf-GP for qemu-devel@nongnu.org; Thu, 28 Jun 2012 15:22:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SkKIO-0002x6-Lj for qemu-devel@nongnu.org; Thu, 28 Jun 2012 15:22:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkKIO-0002wo-CA for qemu-devel@nongnu.org; Thu, 28 Jun 2012 15:22:28 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5SJMR7b032054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Jun 2012 15:22:27 -0400 Received: from trasno.mitica (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5SJMB80000894; Thu, 28 Jun 2012 15:22:26 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2012 21:22:08 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: owasserm@redhat.com Subject: [Qemu-devel] [PATCH 10/12] ram: save_live_complete() only do one loop X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We were doing the same loop that stage2, and a new one for stage3. We only need the one for stage3. Signed-off-by: Juan Quintela Reviewed-by: Orit Wasserman --- arch_init.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/arch_init.c b/arch_init.c index 1eab331..fe843a7 100644 --- a/arch_init.c +++ b/arch_init.c @@ -402,41 +402,10 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) static int ram_save_complete(QEMUFile *f, void *opaque) { - double bwidth = 0; - int ret; - int i; int bytes_sent; memory_global_sync_dirty_bitmap(get_system_memory()); - bwidth = qemu_get_clock_ns(rt_clock); - - i = 0; - while ((ret = qemu_file_rate_limit(f)) == 0) { - bytes_sent = ram_save_block(f); - bytes_transferred += bytes_sent; - if (bytes_sent == 0) { /* no more blocks */ - break; - } - /* we want to check in the 1st loop, just in case it was the 1st time - and we had to sync the dirty bitmap. - qemu_get_clock_ns() is a bit expensive, so we only check each some - iterations - */ - if ((i & 63) == 0) { - uint64_t t1 = (qemu_get_clock_ns(rt_clock) - bwidth) / 1000000; - if (t1 > MAX_WAIT) { - DPRINTF("big wait: %ld milliseconds, %d iterations\n", t1, i); - break; - } - } - i++; - } - - if (ret < 0) { - return ret; - } - /* try transferring iterative blocks of memory */ /* flush all remaining blocks regardless of rate limiting */