From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etkMf-0007xu-TC for qemu-devel@nongnu.org; Wed, 07 Mar 2018 20:29:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etkMf-00006g-7H for qemu-devel@nongnu.org; Wed, 07 Mar 2018 20:29:01 -0500 Date: Thu, 8 Mar 2018 09:28:42 +0800 From: Fam Zheng Message-ID: <20180308012842.GJ13844@lemon.usersys.redhat.com> References: <20180305114533.GI7910@stefanha-x1.localdomain> <0f1ec3c7-1157-e618-62f8-ffd5e08eb342@kamp.de> <20180305145215.GM3131@work-vm> <20180306160739.GN31045@stefanha-x1.localdomain> <824907bb-3a37-27bd-76db-be17d05bdac0@kamp.de> <231fe0ce-3df4-a175-2fba-403023cc65e1@kamp.de> <99df10d6-6514-56ee-16ce-8b7d1823cc08@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99df10d6-6514-56ee-16ce-8b7d1823cc08@kamp.de> Subject: Re: [Qemu-devel] block migration and dirty bitmap reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Stefan Hajnoczi , "Dr. David Alan Gilbert" , wency@cn.fujitsu.com, qemu block , Juan Quintela , "qemu-devel@nongnu.org" , Stefan Hajnoczi On Wed, 03/07 09:06, Peter Lieven wrote: > Hi, > > while looking at the code I wonder if the blk_aio_preadv and the bdrv_reset_dirty_bitmap order must > be swapped in mig_save_device_bulk: > > qemu_mutex_lock_iothread(); > aio_context_acquire(blk_get_aio_context(bmds->blk)); > blk->aiocb = blk_aio_preadv(bb, cur_sector * BDRV_SECTOR_SIZE, &blk->qiov, > 0, blk_mig_read_cb, blk); > > bdrv_reset_dirty_bitmap(bmds->dirty_bitmap, cur_sector * BDRV_SECTOR_SIZE, > nr_sectors * BDRV_SECTOR_SIZE); > aio_context_release(blk_get_aio_context(bmds->blk)); > qemu_mutex_unlock_iothread(); > > In mig_save_device_dirty we first reset the dirty bitmap and read then which shoulds like > a better idea. Yes, that sounds right to me. Fam