[Top][All Lists]

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

Re: [Qemu-block] [PATCH v3 2/5] qcow2: Make the default L2 cache suffici

From: Leonid Bloch
Subject: Re: [Qemu-block] [PATCH v3 2/5] qcow2: Make the default L2 cache sufficient to cover the entire image
Date: Wed, 8 Aug 2018 16:07:10 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 08/08/2018 03:39 PM, Alberto Garcia wrote:
On Wed 08 Aug 2018 09:10:48 AM CEST, Leonid Bloch wrote:
Sufficient L2 cache can noticeably improve the performance when using
large images with frequent I/O. The memory overhead is not significant
in most cases, as the cache size is only 1 MB for each 8 GB of virtual
image size (with the default cluster size of 64 KB). For cases with very
large images and/or small cluster sizes, there is an upper limit on the
default L2 cache: 32 MB.

I find this description a bit confusing.

First of all, because it's not true that the default will cover the
whole image: we're just increasing it, but any image > 256GB is going to
need more than 32MB (with 64KB clusters, that is).

How about the following:

qcow2: Make the default L2 cache try to cover the entire image

Second, because it's not clear what happens if you increase that
maximum. Do you have to calculate the new value? Can you make it larger
than what you actually need?

What if I add after the full text of the comment (which already says about the 'l2-cache-size' option) something like: "In any case, the L2 cache will be set to fit the virtual image size, unless it will require more space than the allowed maximum, in which case it will occupy the allowed maximum only."

The way I see it: there are two simple changes from the user's point of
view (they can even be two separate patches).

1) The default l2-cache-size is now 32MB. DEFAULT_L2_CACHE_CLUSTERS is
    useless now and disappears.
I don't think that it can be a separate patch, because unless the other logic is changed, the cache will occupy 32 MB *always*, regardless of the image size, and that's quite a big and unneeded overhead.

2) QEMU will only use as much memory from l2-cache-size as it can use to
    cover the whole image. Increasing the value of l2-cache-size will not
    use any additional memory, so it's safe to do.

I'll add the clarification that it's safe to increase the l2-cache-size value to the commit message. It is reasonably safe, except of some corner cases with very large image sizes.


reply via email to

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