[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv2 2/9] cutils: add a function to find non-zero c
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCHv2 2/9] cutils: add a function to find non-zero content in a buffer |
Date: |
Tue, 19 Mar 2013 10:43:58 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
On 03/19/2013 10:18 AM, Peter Lieven wrote:
>
> Am 19.03.2013 um 16:54 schrieb Eric Blake <address@hidden>:
>
>> On 03/15/2013 09:50 AM, Peter Lieven wrote:
>>> Signed-off-by: Peter Lieven <address@hidden>
>>> ---
>>> 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
>>> + * sizeof(VECTYPE)) == 0);
>>
>> Good use of it.
>
> A question I had is if these asserts make the code slower? In case of all
> 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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCHv2 4/9] bitops: use vector algorithm to optimize find_next_bit(), (continued)
[Qemu-devel] [PATCHv2 7/9] migration: do not sent zero pages in bulk stage, Peter Lieven, 2013/03/15
[Qemu-devel] [PATCHv2 5/9] migration: search for zero instead of dup pages, Peter Lieven, 2013/03/15
[Qemu-devel] [PATCHv2 1/9] move vector definitions to qemu-common.h, Peter Lieven, 2013/03/15
[Qemu-devel] [PATCHv2 6/9] migration: add an indicator for bulk state of ram migration, Peter Lieven, 2013/03/15