From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlfIc-00066J-6k for qemu-devel@nongnu.org; Mon, 02 Jul 2012 08:00:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SlfIV-00004u-OY for qemu-devel@nongnu.org; Mon, 02 Jul 2012 08:00:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlfIV-0008VU-GR for qemu-devel@nongnu.org; Mon, 02 Jul 2012 08:00:07 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q62C07EN028496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 2 Jul 2012 08:00:07 -0400 Received: from dhcp-1-120.tlv.redhat.com (vpn-200-125.tlv.redhat.com [10.35.200.125]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q62C02QD019294 for ; Mon, 2 Jul 2012 08:00:05 -0400 Message-ID: <4FF18D51.9060108@redhat.com> Date: Mon, 02 Jul 2012 15:00:17 +0300 From: Orit Wasserman MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/12] ram: save_live_complete() only do one loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 06/28/2012 10:22 PM, Juan Quintela wrote: > 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 > --- > 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 */ > Reviewed-by: Orit Wasserman