From nobody Mon Feb 9 01:01:41 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523968753719747.1336907055869; Tue, 17 Apr 2018 05:39:13 -0700 (PDT) Received: from localhost ([::1]:36246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8PtB-0002Rf-0h for importer@patchew.org; Tue, 17 Apr 2018 08:39:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8Prh-0001jI-0M for qemu-devel@nongnu.org; Tue, 17 Apr 2018 08:37:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8Prd-0005R8-Qb for qemu-devel@nongnu.org; Tue, 17 Apr 2018 08:37:41 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:52124) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f8Prd-0005QA-E9; Tue, 17 Apr 2018 08:37:37 -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 1f8Pra-0006wJ-9J; Tue, 17 Apr 2018 14:37:34 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1f8PrH-000507-DW; Tue, 17 Apr 2018 15:37:15 +0300 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=HzVe7spss2ny8GyaOEcqY+BtN8W/StOeOGjrPi3uVU8=; b=L5h8/F+wNqegam43+eZvbdP/+1vlDdjkpg79rc//2Zl+FBzEnAlFwaD/p9pCUm2xAmGoc5FjxM+ufqFJqZVOkg7C9al/Co9NlKAi89ik7yITukvv1Cb/bdW0LBwNr87PoVq+U2XekSEJ7utFZDdtF6EN+AwrDhQ107B1WZ5Xhh7OJ7U8CgZ9b/P67D08vQDxK0C/RqW5/73WAmftevjB+g20LkJ5/l8aHbhYZisKBlK3XD3K285QFSIY+Hl3ypXVfwnHCu06Dv1BkIkBXw8avKHyS1nSUyxuorZFTaTJOQGRc5vdq2vp5gV2rC6v/57X/t5ZyWXrGNlnMMAyErrYbQ==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Tue, 17 Apr 2018 15:37:05 +0300 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 v3 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 | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 170191a242..8a09a5cc5f 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -116,31 +116,30 @@ 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 +(this can change if you are using internal snapshots, so you may want +to think about increasing the cache size if you use them heavily). =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