|
|
7711c0 |
From fac45a82432d342bf8cf86fab57af88ba54fb0f4 Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Date: Tue, 19 Feb 2019 17:00:19 +0100
|
|
|
7711c0 |
Subject: [PATCH 18/23] qcow2: Increase the default upper limit on the L2 cache
|
|
|
7711c0 |
size
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Message-id: <20190219170023.27826-10-kwolf@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 84549
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 09/13] qcow2: Increase the default upper limit on the L2 cache size
|
|
|
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: Leonid Bloch <lbloch@janustech.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
The upper limit on the L2 cache size is increased from 1 MB to 32 MB
|
|
|
7711c0 |
on Linux platforms, and to 8 MB on other platforms (this difference is
|
|
|
7711c0 |
caused by the ability to set intervals for cache cleaning on Linux
|
|
|
7711c0 |
platforms only).
|
|
|
7711c0 |
|
|
|
7711c0 |
This is done in order to allow default full coverage with the L2 cache
|
|
|
7711c0 |
for images of up to 256 GB in size (was 8 GB). Note, that only the
|
|
|
7711c0 |
needed amount to cover the full image is allocated. The value which is
|
|
|
7711c0 |
changed here is just the upper limit on the L2 cache size, beyond which
|
|
|
7711c0 |
it will not grow, even if the size of the image will require it to.
|
|
|
7711c0 |
|
|
|
7711c0 |
Signed-off-by: Leonid Bloch <lbloch@janustech.com>
|
|
|
7711c0 |
Reviewed-by: Alberto Garcia <berto@igalia.com>
|
|
|
7711c0 |
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit 80668d0fb735f0839a46278a7d42116089b82816)
|
|
|
7711c0 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
block/qcow2.h | 6 +++++-
|
|
|
7711c0 |
docs/qcow2-cache.txt | 15 +++++++++------
|
|
|
7711c0 |
qemu-options.hx | 6 +++---
|
|
|
7711c0 |
3 files changed, 17 insertions(+), 10 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/block/qcow2.h b/block/qcow2.h
|
|
|
7711c0 |
index d0dd4a2..6c6c742 100644
|
|
|
7711c0 |
--- a/block/qcow2.h
|
|
|
7711c0 |
+++ b/block/qcow2.h
|
|
|
7711c0 |
@@ -74,7 +74,11 @@
|
|
|
7711c0 |
/* Must be at least 4 to cover all cases of refcount table growth */
|
|
|
7711c0 |
#define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */
|
|
|
7711c0 |
|
|
|
7711c0 |
-#define DEFAULT_L2_CACHE_MAX_SIZE S_1MiB
|
|
|
7711c0 |
+#ifdef CONFIG_LINUX
|
|
|
7711c0 |
+#define DEFAULT_L2_CACHE_MAX_SIZE S_32MiB
|
|
|
7711c0 |
+#else
|
|
|
7711c0 |
+#define DEFAULT_L2_CACHE_MAX_SIZE S_8MiB
|
|
|
7711c0 |
+#endif
|
|
|
7711c0 |
|
|
|
7711c0 |
#define DEFAULT_CLUSTER_SIZE S_64KiB
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt
|
|
|
7711c0 |
index 750447e..1fcc065 100644
|
|
|
7711c0 |
--- a/docs/qcow2-cache.txt
|
|
|
7711c0 |
+++ b/docs/qcow2-cache.txt
|
|
|
7711c0 |
@@ -125,12 +125,15 @@ There are a few things that need to be taken into account:
|
|
|
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 |
- - The maximum L2 cache size is 1 MB by default (enough for full coverage
|
|
|
7711c0 |
- of 8 GB images, with the default cluster size). This value can be
|
|
|
7711c0 |
- modified using the "l2-cache-size" option. QEMU will not use more memory
|
|
|
7711c0 |
- than needed to hold all of the image's L2 tables, regardless of this max.
|
|
|
7711c0 |
- value. The minimal L2 cache size is 2 clusters (or 2 cache entries, see
|
|
|
7711c0 |
- below).
|
|
|
7711c0 |
+ - The maximum L2 cache size is 32 MB by default on Linux platforms (enough
|
|
|
7711c0 |
+ for full coverage of 256 GB images, with the default cluster size). This
|
|
|
7711c0 |
+ value can be modified using the "l2-cache-size" option. QEMU will not use
|
|
|
7711c0 |
+ more memory than needed to hold all of the image's L2 tables, regardless
|
|
|
7711c0 |
+ of this max. value.
|
|
|
7711c0 |
+ On non-Linux platforms the maximal value is smaller by default (8 MB) and
|
|
|
7711c0 |
+ this difference stems from the fact that on Linux the cache can be cleared
|
|
|
7711c0 |
+ periodically if needed, using the "cache-clean-interval" option (see below).
|
|
|
7711c0 |
+ The minimal L2 cache size is 2 clusters (or 2 cache entries, see below).
|
|
|
7711c0 |
|
|
|
7711c0 |
- The default (and minimum) refcount cache size is 4 clusters.
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/qemu-options.hx b/qemu-options.hx
|
|
|
7711c0 |
index e1fbc5b..3580d16 100644
|
|
|
7711c0 |
--- a/qemu-options.hx
|
|
|
7711c0 |
+++ b/qemu-options.hx
|
|
|
7711c0 |
@@ -756,9 +756,9 @@ The maximum total size of the L2 table and refcount block caches in bytes
|
|
|
7711c0 |
|
|
|
7711c0 |
@item l2-cache-size
|
|
|
7711c0 |
The maximum size of the L2 table cache in bytes
|
|
|
7711c0 |
-(default: if cache-size is not specified - 1M; otherwise, as large as possible
|
|
|
7711c0 |
-within the cache-size, while permitting the requested or the minimal refcount
|
|
|
7711c0 |
-cache size)
|
|
|
7711c0 |
+(default: if cache-size is not specified - 32M on Linux platforms, and 8M on
|
|
|
7711c0 |
+non-Linux platforms; otherwise, as large as possible within the cache-size,
|
|
|
7711c0 |
+while permitting the requested or the minimal refcount cache size)
|
|
|
7711c0 |
|
|
|
7711c0 |
@item refcount-cache-size
|
|
|
7711c0 |
The maximum size of the refcount block cache in bytes
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|