From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1J7z-0005xh-CM for qemu-devel@nongnu.org; Tue, 24 Nov 2015 14:19:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1J7y-0001Pf-Ex for qemu-devel@nongnu.org; Tue, 24 Nov 2015 14:19:47 -0500 References: <1448013593-14282-1-git-send-email-famz@redhat.com> <1448013593-14282-3-git-send-email-famz@redhat.com> <5653866A.2080003@redhat.com> <20151124022814.GA26733@ad.usersys.redhat.com> From: John Snow Message-ID: <5654B848.7030503@redhat.com> Date: Tue, 24 Nov 2015 14:19:36 -0500 MIME-Version: 1.0 In-Reply-To: <20151124022814.GA26733@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for 2.6 2/3] block: Hide HBitmap in block dirty bitmap interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , vsementsov@virtuozzo.com, qemu-block@nongnu.org, Jeff Cody , qemu-devel@nongnu.org, mreitz@redhat.com, pbonzini@redhat.com On 11/23/2015 09:28 PM, Fam Zheng wrote: > On Mon, 11/23 16:34, John Snow wrote: >> Hmm, what's the idea, here? >> >> This patch does a lot more than just hide hbitmap details from callers >> of block_dirty_bitmap functions. >> >> So we're changing the backing hbitmap to always be one where g=0 and the >> number of physical bits directly is (now) the same as the number of >> 'virtual' bits, pre-patch. Then, to compensate, we handle the shift math >> to convert the bitmap granularity to sector size and vice-versa in the >> Block Dirty Bitmap layer instead of in the hbitmap layer. >> >> What's the benefit? It looks like we just pull all the implementation >> details up from hbitmap and into BdrvDirtyBitmap, which I am not >> immediately convinced of as being a benefit. > > It feels counter intuitive to me with hbitmap handling granularity, it makes it > more like a HGranularityBitmap rather than HBitmap, and is unnecessarily > complex to work on. > I guess it's a matter of personal taste on where to try to hide the complexity. Since hbitmap can and already does manage it for us, inertia leaves me satisfied with this option. I don't know if pulling the granularity out of hbitmap and into BdrvDirtyBitmap (so now we have granularity management code in two objects) is a significant gain, but I wouldn't NACK this over that specifically ... I'll let Vladimir et al decide if this does make e.g. his migration/persistence patches easier to write or not. I agree that the new iterator object for BdrvDirtyBitmap is good, though, and wouldn't mind seeing this split up into its two parts: (1) Hiding the hbitmap implementation detail entirely from users of BdrvDirtyBitmap, by adding new BdrvDirtyBitmap iterators (2) Moving the granularity logic up into BdrvDirtyBitmap > Now it's simplified in that only one BdrvDirtyBitmap needs to care about the > granularity, and which I think is a big benefit when we are going to extend the > dirty bitmap interface, for example to serialize and deserialize for > persistence. > > Fam >