qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Give the refcount cache the minimum possible size by default
@ 2018-03-13 15:02 Alberto Garcia
  2018-03-13 15:02 ` [Qemu-devel] [PATCH 1/2] qcow2: " Alberto Garcia
  2018-03-13 15:02 ` [Qemu-devel] [PATCH 2/2] docs: Document the new default sizes of the qcow2 caches Alberto Garcia
  0 siblings, 2 replies; 7+ messages in thread
From: Alberto Garcia @ 2018-03-13 15:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alberto Garcia, qemu-block, Kevin Wolf, Max Reitz, Eric Blake

Hi,

we talked about this the other day, so here are the patches to change
the default cache sizes in qcow2.

Without this patch:

 * refcount-cache-size = l2-cache-size / 4

unless otherwise specified by the user. This is wasteful, the refcount
cache is accessed sequentially during normal I/O, so there's no point
in caching more tables. I measured the effect on the refcount cache
size when populating an empty qcow2 image using random writes, and
there's no difference between having the minimum or the maximum
sizes(*).

With this patch:

 * refcount-cache-size is always 4 clusters by default (the minimum)

 * If "cache-size" is set then l2-cache-size is set to the maximum if
   possible (disk_size * 8 / cluster_size) and the remainder is
   assigned to the refcount cache.

Regards,

Berto

(*) there is, actually: having a very large cache can even make the
    I/O slightly slower, because the larger the cache the longer it
    takes longer to find a cached entry. I only noticed this under
    tmpfs anyway.

Alberto Garcia (2):
  qcow2: Give the refcount cache the minimum possible size by default
  docs: Document the new default sizes of the qcow2 caches

 block/qcow2.c              | 31 +++++++++++++++++++------------
 block/qcow2.h              |  4 ----
 docs/qcow2-cache.txt       | 31 ++++++++++++++-----------------
 tests/qemu-iotests/137.out |  2 +-
 4 files changed, 34 insertions(+), 34 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-13 19:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-13 15:02 [Qemu-devel] [PATCH 0/2] Give the refcount cache the minimum possible size by default Alberto Garcia
2018-03-13 15:02 ` [Qemu-devel] [PATCH 1/2] qcow2: " Alberto Garcia
2018-03-13 18:23   ` Eric Blake
2018-03-13 18:48     ` Alberto Garcia
2018-03-13 19:10       ` Eric Blake
2018-03-13 15:02 ` [Qemu-devel] [PATCH 2/2] docs: Document the new default sizes of the qcow2 caches Alberto Garcia
2018-03-13 18:25   ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).