|
|
ae23c9 |
From e3455ccc52d50010fdbd1940d7efebd28c65f3ad Mon Sep 17 00:00:00 2001
|
|
|
ae23c9 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
ae23c9 |
Date: Thu, 6 Dec 2018 17:12:27 +0000
|
|
|
ae23c9 |
Subject: [PATCH 02/15] docs: Document the new default sizes of the qcow2
|
|
|
ae23c9 |
caches
|
|
|
ae23c9 |
|
|
|
ae23c9 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
ae23c9 |
Message-id: <20181206171240.5674-3-kwolf@redhat.com>
|
|
|
ae23c9 |
Patchwork-id: 83297
|
|
|
ae23c9 |
O-Subject: [RHEL-8.0 qemu-kvm PATCH 02/15] docs: Document the new default sizes of the qcow2 caches
|
|
|
ae23c9 |
Bugzilla: 1656507
|
|
|
ae23c9 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
ae23c9 |
RH-Acked-by: John Snow <jsnow@redhat.com>
|
|
|
ae23c9 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
ae23c9 |
|
|
|
ae23c9 |
From: Alberto Garcia <berto@igalia.com>
|
|
|
ae23c9 |
|
|
|
ae23c9 |
We have just reduced the refcount cache size to the minimum unless
|
|
|
ae23c9 |
the user explicitly requests a larger one, so we have to update the
|
|
|
ae23c9 |
documentation to reflect this change.
|
|
|
ae23c9 |
|
|
|
ae23c9 |
Signed-off-by: Alberto Garcia <berto@igalia.com>
|
|
|
ae23c9 |
Message-id: c5f0bde23558dd9d33b21fffc76ac9953cc19c56.1523968389.git.berto@igalia.com
|
|
|
ae23c9 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
ae23c9 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
ae23c9 |
(cherry picked from commit 603790ef3aec6a19b1c095188a1d2171934a27de)
|
|
|
ae23c9 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
ae23c9 |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
ae23c9 |
---
|
|
|
ae23c9 |
docs/qcow2-cache.txt | 33 ++++++++++++++++-----------------
|
|
|
ae23c9 |
1 file changed, 16 insertions(+), 17 deletions(-)
|
|
|
ae23c9 |
|
|
|
ae23c9 |
diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt
|
|
|
ae23c9 |
index 170191a..8a09a5c 100644
|
|
|
ae23c9 |
--- a/docs/qcow2-cache.txt
|
|
|
ae23c9 |
+++ b/docs/qcow2-cache.txt
|
|
|
ae23c9 |
@@ -116,31 +116,30 @@ There are three options available, and all of them take bytes:
|
|
|
ae23c9 |
"refcount-cache-size": maximum size of the refcount block cache
|
|
|
ae23c9 |
"cache-size": maximum size of both caches combined
|
|
|
ae23c9 |
|
|
|
ae23c9 |
-There are two things that need to be taken into account:
|
|
|
ae23c9 |
+There are a few things that need to be taken into account:
|
|
|
ae23c9 |
|
|
|
ae23c9 |
- Both caches must have a size that is a multiple of the cluster size
|
|
|
ae23c9 |
(or the cache entry size: see "Using smaller cache sizes" below).
|
|
|
ae23c9 |
|
|
|
ae23c9 |
- - If you only set one of the options above, QEMU will automatically
|
|
|
ae23c9 |
- adjust the others so that the L2 cache is 4 times bigger than the
|
|
|
ae23c9 |
- refcount cache.
|
|
|
ae23c9 |
+ - The default L2 cache size is 8 clusters or 1MB (whichever is more),
|
|
|
ae23c9 |
+ and the minimum is 2 clusters (or 2 cache entries, see below).
|
|
|
ae23c9 |
|
|
|
ae23c9 |
-This means that these options are equivalent:
|
|
|
ae23c9 |
+ - The default (and minimum) refcount cache size is 4 clusters.
|
|
|
ae23c9 |
|
|
|
ae23c9 |
- -drive file=hd.qcow2,l2-cache-size=2097152
|
|
|
ae23c9 |
- -drive file=hd.qcow2,refcount-cache-size=524288
|
|
|
ae23c9 |
- -drive file=hd.qcow2,cache-size=2621440
|
|
|
ae23c9 |
+ - If only "cache-size" is specified then QEMU will assign as much
|
|
|
ae23c9 |
+ memory as possible to the L2 cache before increasing the refcount
|
|
|
ae23c9 |
+ cache size.
|
|
|
ae23c9 |
|
|
|
ae23c9 |
-The reason for this 1/4 ratio is to ensure that both caches cover the
|
|
|
ae23c9 |
-same amount of disk space. Note however that this is only valid with
|
|
|
ae23c9 |
-the default value of refcount_bits (16). If you are using a different
|
|
|
ae23c9 |
-value you might want to calculate both cache sizes yourself since QEMU
|
|
|
ae23c9 |
-will always use the same 1/4 ratio.
|
|
|
ae23c9 |
+Unlike L2 tables, refcount blocks are not used during normal I/O but
|
|
|
ae23c9 |
+only during allocations and internal snapshots. In most cases they are
|
|
|
ae23c9 |
+accessed sequentially (even during random guest I/O) so increasing the
|
|
|
ae23c9 |
+refcount cache size won't have any measurable effect in performance
|
|
|
ae23c9 |
+(this can change if you are using internal snapshots, so you may want
|
|
|
ae23c9 |
+to think about increasing the cache size if you use them heavily).
|
|
|
ae23c9 |
|
|
|
ae23c9 |
-It's also worth mentioning that there's no strict need for both caches
|
|
|
ae23c9 |
-to cover the same amount of disk space. The refcount cache is used
|
|
|
ae23c9 |
-much less often than the L2 cache, so it's perfectly reasonable to
|
|
|
ae23c9 |
-keep it small.
|
|
|
ae23c9 |
+Before QEMU 2.12 the refcount cache had a default size of 1/4 of the
|
|
|
ae23c9 |
+L2 cache size. This resulted in unnecessarily large caches, so now the
|
|
|
ae23c9 |
+refcount cache is as small as possible unless overridden by the user.
|
|
|
ae23c9 |
|
|
|
ae23c9 |
|
|
|
ae23c9 |
Using smaller cache entries
|
|
|
ae23c9 |
--
|
|
|
ae23c9 |
1.8.3.1
|
|
|
ae23c9 |
|