From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asrbn-0002WH-Ab for qemu-devel@nongnu.org; Wed, 20 Apr 2016 08:51:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asrbm-0003o7-9x for qemu-devel@nongnu.org; Wed, 20 Apr 2016 08:51:55 -0400 Date: Wed, 20 Apr 2016 14:51:47 +0200 From: Kevin Wolf Message-ID: <20160420125147.GL6517@noname.str.redhat.com> References: <1461106788-14285-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461106788-14285-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.6 0/2] block/mirror: Fix mirroring with guest I/O load List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, Jeff Cody , Fam Zheng Am 20.04.2016 um 00:59 hat Max Reitz geschrieben: > Bug report: https://bugs.launchpad.net/qemu/+bug/1570134 > > If you are doing a mirror operation (I just tested with block-commit on > the active layer, but I guess any mirroring will do) while the guest has > rather heavy I/O load (or light I/O also, you just need to be more > unlucky) will lead to the cache of mirror's bitmap iterator becoming > stale and not reflect all dirty bits which are set in the drive's dirty > bitmap. > > Generally, this isn't bad because we just restart over once we are > through, and this will refresh the iterator's cache. > > But it is bad for the code which tries to find a contiguous range of > dirty chunks. This code needs to clear the bits in the iterator, so it > invokes hbitmap_iter_next() for every contiguous dirty chunk found. But > then it has to make sure that this actually cleared that chunk's dirty > bit: And if the iterator's cache is stale, this may not be the case. > Then, we run into a failed assertion. > > But detecting this discrepancy is easy and refreshing the iterator's > cache is too; and then, the assertion holds. > > Besides this (patch 2), the code which is supposed to wait for > overlapping in-flight requests on the first chunk of a dirty range is > dead. I didn't produce any problems regarding that, but I'm sure it's > not good. Patch 1 fixes that. Thanks, applied to the block branch. Kevin