[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 01/23] multifd: Delete useless operation
From: |
Juan Quintela |
Subject: |
Re: [PATCH v3 01/23] multifd: Delete useless operation |
Date: |
Fri, 26 Nov 2021 10:39:55 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> * Juan Quintela (quintela@redhat.com) wrote:
>> "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
>> > * Juan Quintela (quintela@redhat.com) wrote:
>> >> We are divining by page_size to multiply again in the only use.
>> > ^--- typo
>> >> Once there, impreve the comments.
>> > ^--- typo
>> >>
>> >> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> >
>> > OK, with the typo's fixed:
>>
>> Thanks.
>>
>> > Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>> >
>> > but, could you also explain the x 2 (that's no worse than the current
>> > code); is this defined somewhere in zlib? I thought there was a routine
>> > that told you the worst case?
>>
>> Nowhere.
>>
>> There are pathological cases where it can be worse. Not clear at all
>> how much (ok, for zlib it appears that it is on the order of dozen of
>> bytes, because it marks it as uncompressed on the worst possible case),
>> For zstd, there is not a clear/fast answer when you google.
>
> For zlib:
>
> ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
> /*
> compressBound() returns an upper bound on the compressed size after
> compress() or compress2() on sourceLen bytes. It would be used before a
> compress() or compress2() call to allocate the destination buffer.
> */
Aha, exaactly what I needed.
thanks.
zstd one is called:
ZSTD_compressBound()
Added to the series.
Thanks, Juan.
[PATCH v3 02/23] migration: Never call twice qemu_target_page_size(), Juan Quintela, 2021/11/24
[PATCH v3 03/23] multifd: Rename used field to num, Juan Quintela, 2021/11/24
[PATCH v3 05/23] multifd: The variable is only used inside the loop, Juan Quintela, 2021/11/24
[PATCH v3 08/23] multifd: Fill offset and block for reception, Juan Quintela, 2021/11/24