[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 8/8] docs: document how to configure the qcow2 L
Re: [Qemu-devel] [PATCH 8/8] docs: document how to configure the qcow2 L2/refcount caches
Mon, 11 May 2015 16:08:05 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
On 11.05.2015 15:30, Alberto Garcia wrote:
On Mon 11 May 2015 03:23:25 PM CEST, Max Reitz <address@hidden> wrote:
+ disk_size = l2_cache_size * cluster_size / 8
+ disk_size = refcount_cache_size * cluster_size / 2
Only with the default of refcount_bits=16. In the general case, it's
refcount_cache_size * cluster_size * 8 / refcount_bits.
I actually omitted that on purpose because I didn't want to go into too
many details and I hadn't realized that it's now possible to configure
refcount_bits. I will correct the document.
I wonder what happens then to this DEFAULT_L2_REFCOUNT_SIZE_RATIO of 4,
because that's only valid if refcount_bits == 16.
Is the user supposed to calculate that ratio manually and configure both
Well... Considering nobody will probably ever use refcount_bits > 16, we
don't need to worry about 4 being too big of a ratio. And I think, for
cases of refcount_bits < 16, we wouldn't really save as much to justify
adjusting the ratio. So while it would be possible to make qcow2 choose
a variable ratio based on refcount_bits, I don't think we really need to
care about it.
But as for the user, I do think they should care about it, or at least
know about it. If they are already adjusting the cache sizes manually,
they should know exactly what the ratio should be. For justifying why
qemu does not adjust its default ratio, I think it's enough to write
that that default ratio (4) is geared towards the default value of
refcount_bits (16) and that should be enough.
If we do decide to implement a variable ratio later on, we can still
change this documentation.
Oh, and also note that the "range covered" by the metadata caches are
different things: For the L2 tables, it's a guest offset range, while
for the refblocks it's a host offset range. Also, you basically only
need the refcounts for allocating clusters and doing internal snapshot
operations (you don't need them for reads, and you don't need them for
non-allocating writes, thanks to the O_COPIED flag), so it would
actually make sense for the user to choose a ratio larger than 64 /
refcount_bits because refcounts are (1) rarely ever needed, and (2) when
they are needed, they are most likely for allocation, which most likely
will occur at the image's end (unless you're using internal snapshots or
you're manually discarding things), so you actually only need to cache
the refblock covering the image end.
Apart from this minor thing, looks good. Well, except that maybe it
should be preferred to use .qcow2 as the extension for qcow2 files
(instead of .img).
Sure, I can change that too.
- [Qemu-devel] [PATCH v3 0/8] qcow2 L2/refcount cache improvements, Alberto Garcia, 2015/05/11
- [Qemu-devel] [PATCH 2/8] qcow2: simplify qcow2_cache_put() and qcow2_cache_entry_mark_dirty(), Alberto Garcia, 2015/05/11
- [Qemu-devel] [PATCH 3/8] qcow2: use an LRU algorithm to replace entries from the L2 cache, Alberto Garcia, 2015/05/11
- [Qemu-devel] [PATCH 5/8] qcow2: use a hash to look for entries in the L2 cache, Alberto Garcia, 2015/05/11
- [Qemu-devel] [PATCH 8/8] docs: document how to configure the qcow2 L2/refcount caches, Alberto Garcia, 2015/05/11
- Re: [Qemu-devel] [PATCH 8/8] docs: document how to configure the qcow2 L2/refcount caches, Eric Blake, 2015/05/11
- [Qemu-devel] [PATCH 7/8] qcow2: style fixes in qcow2-cache.c, Alberto Garcia, 2015/05/11
- [Qemu-devel] [PATCH 6/8] qcow2: make qcow2_cache_put() a void function, Alberto Garcia, 2015/05/11
- [Qemu-devel] [PATCH 1/8] qcow2: use one single memory block for the L2/refcount cache tables, Alberto Garcia, 2015/05/11
- [Qemu-devel] [PATCH 4/8] qcow2: remove qcow2_cache_find_entry_to_replace(), Alberto Garcia, 2015/05/11
- Re: [Qemu-devel] [PATCH v3 0/8] qcow2 L2/refcount cache improvements, Kevin Wolf, 2015/05/12