From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMafV-0002Jl-QT for qemu-devel@nongnu.org; Wed, 18 May 2011 02:55:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMafR-0007dK-Ix for qemu-devel@nongnu.org; Wed, 18 May 2011 02:55:41 -0400 Received: from mail-bw0-f45.google.com ([209.85.214.45]:63294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMafR-0007dD-8w for qemu-devel@nongnu.org; Wed, 18 May 2011 02:55:37 -0400 Received: by bwz16 with SMTP id 16so1245765bwz.4 for ; Tue, 17 May 2011 23:55:36 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 18 May 2011 10:55:35 +0400 Message-ID: From: Dmitry Konishchev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] [qemu-img] CPU consuming optimization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , stanislav.ievlev@gmail.com, qemu-devel@nongnu.org On Tue, May 17, 2011 at 7:35 PM, Stefan Hajnoczi wrote= : > Please see http://wiki.qemu.org/Contribute/SubmitAPatch, which asks > that patches are sent inline (not as attachments) for easy review and > that you follow the coding style (see the CODING_STYLE file). =A0Patches > also need a Signed-off-by: line. OK, thanks. I'll fix this in case you are willing to accept the patch. On Tue, May 17, 2011 at 7:35 PM, Stefan Hajnoczi wrote= : > The unrolled loop makes the function rely on len being a multiple of > sizeof(long) * 4, otherwise it accesses beyond the end of sector[]. > So for this use case it's okay but the function is generic anymore. Yeah, but this function is static and within the whole file it is used only for comparing clusters, so I think that we can sacrifice it's universality for the sake of the performance. On Tue, May 17, 2011 at 7:35 PM, Stefan Hajnoczi wrote= : > GNU cp(1) tries to detect holes in files and image formats could tell > us about unallocated regions using bdrv_is_allocated(). =A0So I think > there are ways to avoid comparing so much data in the first place, if > you are interested in looking into that. OK, thanks, I'll look on this function (but sorry, only after 2 weeks, since I'm on my vacation). But actually I think, that it will be better to use the both ways, since they can give a boost in different usecases. So, if you are agreed with the said above, you can accept this patch and then I'll write an enchancement for it with bdrv_is_allocated() because it is going to include this patch. -- Dmitry Konishchev mailto:konishchev@gmail.com