Blame SOURCES/kvm-docs-Document-the-new-default-sizes-of-the-qcow2-cac.patch

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