qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] qcow2: Give the refcount cache the minimum


From: Alberto Garcia
Subject: Re: [Qemu-devel] [PATCH 1/2] qcow2: Give the refcount cache the minimum possible size by default
Date: Tue, 13 Mar 2018 19:48:24 +0100
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Tue 13 Mar 2018 07:23:36 PM CET, Eric Blake wrote:
>> +                *refcount_cache_size =
>> +                    MIN(combined_cache_size, min_refcount_cache);
>
> but here, if combined_cache_size is smaller than min_refcount_cache,
>
>> +                *l2_cache_size = combined_cache_size - *refcount_cache_size;
>
> then l2_cache_size is set to a negative value.

No, it's set to 0.

If combined == 4k and min_refcount == 256, then

   refcount_cache_size = MIN(4k, 256k) // 4k
   l2_cache_size = 4k - 4k; // 0

Then the caller ensures that it's always set to the minimum (as it did
with the previous code).

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]