From: Alberto Garcia <berto@igalia.com>
To: qemu-devel@nongnu.org
Cc: Alberto Garcia <berto@igalia.com>,
qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
Max Reitz <mreitz@redhat.com>, Eric Blake <eblake@redhat.com>
Subject: [Qemu-devel] [PATCH v2 0/2] Give the refcount cache the minimum possible size by default
Date: Wed, 14 Mar 2018 10:29:05 +0200 [thread overview]
Message-ID: <cover.1521016003.git.berto@igalia.com> (raw)
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.
Changes:
v2:
- s/overriden/overridden/ (in both patches)
v1: https://lists.gnu.org/archive/html/qemu-block/2018-03/msg00709.html
- Initial release
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
next reply other threads:[~2018-03-14 8:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 8:29 Alberto Garcia [this message]
2018-03-14 8:29 ` [Qemu-devel] [PATCH v2 1/2] qcow2: Give the refcount cache the minimum possible size by default Alberto Garcia
2018-04-13 15:00 ` Max Reitz
2018-04-16 13:56 ` Alberto Garcia
2018-04-16 14:05 ` Max Reitz
2018-04-16 14:31 ` Alberto Garcia
2018-04-16 16:14 ` Max Reitz
2018-03-14 8:29 ` [Qemu-devel] [PATCH v2 2/2] docs: Document the new default sizes of the qcow2 caches Alberto Garcia
2018-04-16 16:15 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1521016003.git.berto@igalia.com \
--to=berto@igalia.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).