From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHzdu-0002kx-LU for qemu-devel@nongnu.org; Tue, 19 Mar 2013 12:44:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHzds-0002bH-NN for qemu-devel@nongnu.org; Tue, 19 Mar 2013 12:44:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHzds-0002b1-EX for qemu-devel@nongnu.org; Tue, 19 Mar 2013 12:44:04 -0400 Message-ID: <514895CE.5050400@redhat.com> Date: Tue, 19 Mar 2013 10:43:58 -0600 From: Eric Blake MIME-Version: 1.0 References: <1363362619-3190-1-git-send-email-pl@kamp.de> <1363362619-3190-3-git-send-email-pl@kamp.de> <51488A32.8060707@redhat.com> <661F4D86-792E-4DD8-B0A6-B46AEE6211E8@kamp.de> In-Reply-To: <661F4D86-792E-4DD8-B0A6-B46AEE6211E8@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2BEBMELKSOMKHQVDTINDC" Subject: Re: [Qemu-devel] [PATCHv2 2/9] cutils: add a function to find non-zero content in a buffer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2BEBMELKSOMKHQVDTINDC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/19/2013 10:18 AM, Peter Lieven wrote: >=20 > Am 19.03.2013 um 16:54 schrieb Eric Blake : >=20 >> On 03/15/2013 09:50 AM, Peter Lieven wrote: >>> Signed-off-by: Peter Lieven >>> --- >>> include/qemu-common.h | 2 ++ >>> util/cutils.c | 40 ++++++++++++++++++++++++++++++++++++++++= >>> 2 files changed, 42 insertions(+) >>> >> >>> >>> +#define BUFFER_FIND_NONZERO_OFFSET_UNROLL_FACTOR 8 >> >> Good. >> >>> + assert(len % (BUFFER_FIND_NONZERO_OFFSET_UNROLL_FACTOR=20 >>> + * sizeof(VECTYPE)) =3D=3D 0); >> >> Good use of it. >=20 > A question I had is if these asserts make the code slower? In case of a= ll > the 4k pages in RAM migration this could be significant. Yes, it probably does slow things down when asserts are enabled. I'm not sure whether it is better to keep the code forcefully robust, or to rely on auditing all callers for properly obeying assumptions. Maybe you should wait for an opinion from one of the maintainers. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2BEBMELKSOMKHQVDTINDC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRSJXOAAoJEKeha0olJ0Nq+YEIAIgrfma58nVBVL6frSrGNz0m 3vhf/m+jzGHKrBkItSZXm97SNSQcPLu49SdNzAQw0CXLGbur/ZMZwI/D1mKAcMY2 YkPZGBMsZtfBVW6DwRMo+G29KZUFAbyVdS2xETJQrEoN5euZg4AAPFuQu04NoQPu l+10ej+8lienqF6n6t+2uVkUrurQbxZLjEgEwjQ4omE8X2808oIbvbmE9CxIsrF5 cFzCWA65ejSLvtgxpBlg/4dJUbFHn9G/rMabZ5QzXfxEeWzA/dxGJnuuJ1pmRt5s JM7sDjNOheRdPzwAIyPLvQnpVrgApvc1lOTTtVsZ/C10Q66JwBG+t9/5uDh5BAo= =G3DF -----END PGP SIGNATURE----- ------enig2BEBMELKSOMKHQVDTINDC--