From nobody Mon Feb 9 06:33:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521016286949343.90976809487097; Wed, 14 Mar 2018 01:31:26 -0700 (PDT) Received: from localhost ([::1]:44938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ew1oc-0000Wp-RG for importer@patchew.org; Wed, 14 Mar 2018 04:31:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ew1mv-0007yl-Vf for qemu-devel@nongnu.org; Wed, 14 Mar 2018 04:29:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ew1mr-0004kn-2s for qemu-devel@nongnu.org; Wed, 14 Mar 2018 04:29:33 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:33865) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ew1mq-0004js-Mq; Wed, 14 Mar 2018 04:29:29 -0400 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1ew1mo-0005C1-AB; Wed, 14 Mar 2018 09:29:26 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1ew1mX-0000TS-OF; Wed, 14 Mar 2018 10:29:09 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=rIG1CKiCnzi2hWvHoTDS6oyzC2WQSXJzfKqx1misZ0M=; b=YUM6T5dX6OM635nSIebHX8/Rh/bn9VCZzXNb68LyQd7dxi6xUi0RLBbBE8tYlOjjNQQT+Xj9wxX7xovl9dukl6s4Ryijo6XHR63soBzF2XbOYOOXBv3uzdoeSzNB4A+s1nNlj/vwZjqSQMyQfVaz4Vuvk0ubZ6FK4Mko7sd+VEKQ00A1TPWvJ3gjMyMp5DX7DFFMPSdR3LHzZuJOAYXqpA9NNJqMnYO0BE8r5W+MU8SuHFfRaulnaVAVRO7pzsts1OSCJ6uJ/RJS13in8tyFu3rmXLXEOq1hCZ+0NKvNBN4l2QeVe6eTxFNgUq7IGit3Ws9bEYbOOd1XJXlRxXTSHg==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 14 Mar 2018 10:29:07 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH v2 2/2] docs: Document the new default sizes of the qcow2 caches X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We have just reduced the refcount cache size to the minimum unless the user explicitly requests a larger one, so we have to update the documentation to reflect this change. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- docs/qcow2-cache.txt | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 170191a242..c640d45d06 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -116,31 +116,28 @@ There are three options available, and all of them ta= ke bytes: "refcount-cache-size": maximum size of the refcount block cache "cache-size": maximum size of both caches combined =20 -There are two things that need to be taken into account: +There are a few things that need to be taken into account: =20 - Both caches must have a size that is a multiple of the cluster size (or the cache entry size: see "Using smaller cache sizes" below). =20 - - If you only set one of the options above, QEMU will automatically - adjust the others so that the L2 cache is 4 times bigger than the - refcount cache. + - The default L2 cache size is 8 clusters or 1MB (whichever is more), + and the minimum is 2 clusters (or 2 cache entries, see below). =20 -This means that these options are equivalent: + - The default (and minimum) refcount cache size is 4 clusters. =20 - -drive file=3Dhd.qcow2,l2-cache-size=3D2097152 - -drive file=3Dhd.qcow2,refcount-cache-size=3D524288 - -drive file=3Dhd.qcow2,cache-size=3D2621440 + - If only "cache-size" is specified then QEMU will assign as much + memory as possible to the L2 cache before increasing the refcount + cache size. =20 -The reason for this 1/4 ratio is to ensure that both caches cover the -same amount of disk space. Note however that this is only valid with -the default value of refcount_bits (16). If you are using a different -value you might want to calculate both cache sizes yourself since QEMU -will always use the same 1/4 ratio. +Unlike L2 tables, refcount blocks are not used during normal I/O but +only during allocations and internal snapshots. In most cases they are +accessed sequentially (even during random guest I/O) so increasing the +refcount cache size won't have any measurable effect in performance. =20 -It's also worth mentioning that there's no strict need for both caches -to cover the same amount of disk space. The refcount cache is used -much less often than the L2 cache, so it's perfectly reasonable to -keep it small. +Before QEMU 2.12 the refcount cache had a default size of 1/4 of the +L2 cache size. This resulted in unnecessarily large caches, so now the +refcount cache is as small as possible unless overridden by the user. =20 =20 Using smaller cache entries --=20 2.11.0