From nobody Wed Nov 5 10:33:20 2025 Delivered-To: importer@patchew.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 1533882929949632.6422917039946; Thu, 9 Aug 2018 23:35:29 -0700 (PDT) Received: from localhost ([::1]:54584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo115-0004Ov-8i for importer@patchew.org; Fri, 10 Aug 2018 02:35:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo0tb-0006u0-57 for qemu-devel@nongnu.org; Fri, 10 Aug 2018 02:27:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo0tY-0001hy-Ev for qemu-devel@nongnu.org; Fri, 10 Aug 2018 02:27:35 -0400 Received: from mail-by2nam01on0097.outbound.protection.outlook.com ([104.47.34.97]:27072 helo=NAM01-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fo0tY-0001gc-0z; Fri, 10 Aug 2018 02:27:32 -0400 Received: from Jupiter.local (141.226.29.227) by SN2PR07MB2623.namprd07.prod.outlook.com (2603:10b6:804:8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.21; Fri, 10 Aug 2018 06:27:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janustech.onmicrosoft.com; s=selector1-janustech-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dzkM/FPwg7QoFfYAAG3zAZ7E1qVfLlb/rHHi76j0vak=; b=rI67EcJkbcRr0xenVRWn5G7RLz4ohVYTLsRggKQgRH8K7donU8Gh0inIRjQhLkB8W4XndarrvrcR4P+a2TAGHqbkY4+8bWlcvJ7eGMGBh7S4MhpxqMfsWwFfyktGJnCzDaVq77iuYkBQvf9t7eYvXFC2DwtUmdhLSDCZc9sRCDI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; From: Leonid Bloch To: qemu-devel@nongnu.org Date: Fri, 10 Aug 2018 09:26:43 +0300 Message-Id: <20180810062647.23211-6-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180810062647.23211-1-lbloch@janustech.com> References: <20180810062647.23211-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: HE1PR05CA0232.eurprd05.prod.outlook.com (2603:10a6:3:fa::32) To SN2PR07MB2623.namprd07.prod.outlook.com (2603:10b6:804:8::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c1141f7-6cc2-4906-5193-08d5fe8a58ee X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021125)(8989117)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990107)(7048125)(7024125)(7027125)(7028125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN2PR07MB2623; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2623; 3:p8fzNxVN2fMYIT8gB90FQjdbPJbuh8ZWFrt/DbCzpzjADlUfQDUGxLA4DERWbGadhrqbBwcsnzsqN5+top/YI8Hh5md8G/JY1XUBof7NndjghDDUGpvrtZEGvY+F0bvqFAViq701CkQ+T/SQS0gQ/3Fnroun6hKBCB0x8oN7w7Orug7P7I6Zk+uZmIZ3xmC1vv00A3Y+aKk0Dy+JGnXQvROVG4mwwYCSqSUNNtCvMfArv+TvqusO4VbPtz5V21VR; 25:15wIWtl+0XQltlAvNxHbwnIpoFw8K3qINZS/rICPFyIwQWJ71DN9O3x0A0eliEIUZf1sebj0XETBuVkNh8B2fb4hEhHHKB5SfLu57qmvkdJxuxvgFsJhidY57qxJ/EIErpBCGgSi6Bz12ZQZx/n4DZqEYOHFAoizrgNCN7nZS0cVTUDNpUh4XywywCZNEgZpV4YW194M2u/j4sJEBtVXLqNAmjlUnLxIdtY3huiTqZInGpdAft5Dlx+skQquICKIRfoOrQNYbkSFEjzKN4U/7nfXUIe08f1pf0mwvLocNSbmW8R/eMxaqhYxy6cjSA1hqIwhlTv1c7uY4949PqhTcQ==; 31:95/wUM2YxosiiUoJZ1nh1suzu7s/pfOyEVyPEaNmgq8x0yhHR929fo+ZGxwI7jb//j8boCm7SEA3Sr1LHIWiXwGMDbZpMjKVOj+MEEQh/XC5KblNTKVAgaJmLTiudsCaJuCtHVDOsF7KqUq90v0EXHC3JjnLwVxVxx/MClCXcQE+hhpn9Sq12MlldeEonCvXOcv43P04fwr2DDyiYP3If3xUIMlrIzEmTnzl9+9gCuU= X-MS-TrafficTypeDiagnostic: SN2PR07MB2623: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(2016111802025)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6043046)(6072148)(201708071742011)(7699016); SRVR:SN2PR07MB2623; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB2623; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2623; 4:bLYB+lmV2GgwENB4bdIdQi+53eBmlnMOZ/VCiFURWHaEqnTinnruYtOAQ+FVXA24gPjDfVpB+R9gwgn9AWBEFu/VI0q21y2n3cE4SF7BbxA9+u/rTC5jn218gEKKn6CucA0M6ltVvdt2QmSSMBNkedUJ7SYFZG/gJ4nJgLZuZT4TqB14pJlpBvlQLYD12HVI7cev+AGIty0Ff6OueNYgh2ru6Vh6YP30r3dJcCxpOI/XJlteRKvQiYC00UfS8H6fsGeVaZXq+lLgDmPIgk9+bA== X-Forefront-PRVS: 07607ED19A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39840400004)(366004)(396003)(346002)(136003)(376002)(199004)(189003)(36756003)(2361001)(68736007)(47776003)(107886003)(551984002)(105586002)(4326008)(5660300001)(186003)(106356001)(16586007)(2351001)(6506007)(316002)(26005)(76176011)(16526019)(86362001)(6916009)(54906003)(6666003)(386003)(25786009)(478600001)(11346002)(6116002)(8676002)(3846002)(81166006)(50466002)(2906002)(81156014)(2616005)(53936002)(51416003)(446003)(48376002)(6486002)(66066001)(486006)(7736002)(476003)(305945005)(52116002)(50226002)(97736004)(14444005)(1076002)(956004)(8936002)(6512007); DIR:OUT; SFP:1102; SCL:1; SRVR:SN2PR07MB2623; H:Jupiter.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; 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; Received-SPF: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR07MB2623; 23:OrGsAXPx1lxPLhlx0wwFRk4wtMVSs+RL3lwJG+Uzj?= =?us-ascii?Q?TLaJLPQEaHnwXXBhLEUXumWgXPc00nYHe1OL5nAOiWHbAh4uW7yFfQHjYLLE?= =?us-ascii?Q?v3scKxWft2nD/ZGXbfg0Eb8cM24+DmHcC0N9HUWJolexzggeRXIgjXfJIGSA?= =?us-ascii?Q?gTxN827X1lUzxVW5NVNqnM1rbC34GQVEGJzEGChZua0kg7/ssr0gBJ5pYB0w?= =?us-ascii?Q?t0C2wb+UZxfjzT+iKGJaXg3+jqAbmU41YbYmQqhYU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JomdzBlfUCK6ECq/92vKDLE6IuGRCfLeQQWACanLkN32G45g==; 5:KrbI6jgDY+TOQNrzkUpd0gbO3kekp8S8tDL8uNAJrmIT25znKZ4gLKznVPduW4gq7DiNI+eXXWrDXbTgtmV28lKZdUcS8ZG+z4shU3G6gunbRTciKjHdhvoAE/eyHETqIhgecdvNP/VJJNxiKHSHPGvTcQ1A4H4JTD2HHQr3pg4=; 7:1Iw2xufPuvV6oLK6lbFGwRCpYD6P8/ZOouva8jiGRP37YUYF2mhlRvDOlfh4nOdwpKC7sTI58M7gC8Th+mHLbgQPtXeZFRafq4I/GpHcN4Vnf1VlNikctGN7jEoCxNWm1POW/Ac4YKvtcSE01ZDQAPO4qGH7FOsqlASaJBLs49QWSGVpxfzxCwHml7IFKnxC+3ifvuMFs79n2lh7uHZRx/ucSkTRlCzsYMw7d4iGeFgk0IJkgvi2aQfQrmyfz462 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2018 06:27:27.0936 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c1141f7-6cc2-4906-5193-08d5fe8a58ee X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2623 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.97 Subject: [Qemu-devel] [PATCH v7 5/9] qcow2: Assign the L2 cache relatively to the image size 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 , Leonid Bloch 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 Content-Type: text/plain; charset="utf-8" Sufficient L2 cache can noticeably improve the performance when using large images with frequent I/O. Previously, the L2 cache was allocated without considering the image size, and an option existed to manually determine its size. Thus to achieve a full coverage of an image by the L2 cache (i.e. use more than the default value of MAX(1 MB, 8 clusters)), a user needed to calculate the required size manually, or with a script, and pass this value to the 'l2-cache-size' option. Now, the L2 cache is assigned taking the virtual image size into account, and will cover the entire image, unless the size needed for that is larger than a certain maximum. This maximum is set to 1 MB by default (enough to cover an 8 GB image with the default cluster size) but can be increased or decreased using the 'l2-cache-size' option. This option was previously documented as the *maximum* L2 cache size, and this patch makes it behave as such, instead of as a constant size. Also, the existing option 'cache-size' can limit the sum of both L2 and refcount caches, as previously. Signed-off-by: Leonid Bloch --- block/qcow2.c | 22 ++++++++++------------ block/qcow2.h | 4 +--- docs/qcow2-cache.txt | 13 ++++++++----- qemu-options.hx | 6 +++--- tests/qemu-iotests/137 | 1 - tests/qemu-iotests/137.out | 1 - 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 053242f94e..434fb89076 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -777,16 +777,19 @@ static void read_cache_sizes(BlockDriverState *bs, Qe= muOpts *opts, uint64_t *refcount_cache_size, Error **errp) { BDRVQcow2State *s =3D bs->opaque; - uint64_t combined_cache_size; + uint64_t combined_cache_size, l2_cache_max_setting; bool l2_cache_size_set, refcount_cache_size_set, combined_cache_size_s= et; int min_refcount_cache =3D MIN_REFCOUNT_CACHE_SIZE * s->cluster_size; + uint64_t virtual_disk_size =3D bs->total_sectors * BDRV_SECTOR_SIZE; + uint64_t max_l2_cache =3D virtual_disk_size / (s->cluster_size / 8); =20 combined_cache_size_set =3D qemu_opt_get(opts, QCOW2_OPT_CACHE_SIZE); l2_cache_size_set =3D qemu_opt_get(opts, QCOW2_OPT_L2_CACHE_SIZE); refcount_cache_size_set =3D qemu_opt_get(opts, QCOW2_OPT_REFCOUNT_CACH= E_SIZE); =20 combined_cache_size =3D qemu_opt_get_size(opts, QCOW2_OPT_CACHE_SIZE, = 0); - *l2_cache_size =3D qemu_opt_get_size(opts, QCOW2_OPT_L2_CACHE_SIZE, 0); + l2_cache_max_setting =3D qemu_opt_get_size(opts, QCOW2_OPT_L2_CACHE_SI= ZE, + DEFAULT_L2_CACHE_MAX_SIZE); *refcount_cache_size =3D qemu_opt_get_size(opts, QCOW2_OPT_REFCOUNT_CACHE_SIZE= , 0); =20 @@ -794,13 +797,16 @@ static void read_cache_sizes(BlockDriverState *bs, Qe= muOpts *opts, QCOW2_OPT_L2_CACHE_ENTRY_SIZE, s->cluster_size); =20 + *l2_cache_size =3D MIN(max_l2_cache, l2_cache_max_setting); + if (combined_cache_size_set) { if (l2_cache_size_set && refcount_cache_size_set) { error_setg(errp, QCOW2_OPT_CACHE_SIZE ", " QCOW2_OPT_L2_CACHE_= SIZE " and " QCOW2_OPT_REFCOUNT_CACHE_SIZE " may not be = set " "at the same time"); return; - } else if (*l2_cache_size > combined_cache_size) { + } else if (l2_cache_size_set && + (l2_cache_max_setting > combined_cache_size)) { error_setg(errp, QCOW2_OPT_L2_CACHE_SIZE " may not exceed " QCOW2_OPT_CACHE_SIZE); return; @@ -815,13 +821,9 @@ static void read_cache_sizes(BlockDriverState *bs, Qem= uOpts *opts, } else if (refcount_cache_size_set) { *l2_cache_size =3D combined_cache_size - *refcount_cache_size; } else { - uint64_t virtual_disk_size =3D bs->total_sectors * BDRV_SECTOR= _SIZE; - uint64_t max_l2_cache =3D virtual_disk_size / (s->cluster_size= / 8); - /* Assign as much memory as possible to the L2 cache, and * use the remainder for the refcount cache */ - if (combined_cache_size >=3D max_l2_cache + min_refcount_cache= ) { - *l2_cache_size =3D max_l2_cache; + if (combined_cache_size >=3D *l2_cache_size + min_refcount_cac= he) { *refcount_cache_size =3D combined_cache_size - *l2_cache_s= ize; } else { *refcount_cache_size =3D MIN(combined_cache_size, @@ -829,10 +831,6 @@ static void read_cache_sizes(BlockDriverState *bs, Qem= uOpts *opts, *l2_cache_size =3D combined_cache_size - *refcount_cache_s= ize; } } - } else if (!l2_cache_size_set) { - *l2_cache_size =3D MAX(DEFAULT_L2_CACHE_SIZE, - (uint64_t)DEFAULT_L2_CACHE_CLUSTERS - * s->cluster_size); } /* If refcount-cache-size is not specified, it will be set to minimum * in qcow2_update_options_prepare(). No need to set it here. */ diff --git a/block/qcow2.h b/block/qcow2.h index 39e1b279f8..d917b5f577 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -74,9 +74,7 @@ /* Must be at least 4 to cover all cases of refcount table growth */ #define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */ =20 -/* Whichever is more */ -#define DEFAULT_L2_CACHE_CLUSTERS 8 /* clusters */ -#define DEFAULT_L2_CACHE_SIZE (1 * MiB) +#define DEFAULT_L2_CACHE_MAX_SIZE (1 * MiB) =20 #define DEFAULT_CLUSTER_SIZE (64 * KiB) =20 diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 0f157d859a..69af306267 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -124,8 +124,11 @@ There are a few things that need to be taken into acco= unt: - 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 - - 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). + - The default L2 cache size will cover the entire virtual size of an + image, up to a certain maximum. This maximum is 1 MB by default + (enough for image sizes of up to 8 GB with the default cluster size) + and it can be reduced or enlarged using the "l2-cache-size" option. + The minimum is 2 clusters (or 2 cache entries, see below). =20 - The default (and minimum) refcount cache size is 4 clusters. =20 @@ -183,9 +186,9 @@ Some things to take into account: always uses the cluster size as the entry size. =20 - If the L2 cache is big enough to hold all of the image's L2 tables - (as explained in the "Choosing the right cache sizes" section - earlier in this document) then none of this is necessary and you - can omit the "l2-cache-entry-size" parameter altogether. + (the default behavior for images of up to 8 GB in size) then none + of this is necessary and you can omit the "l2-cache-entry-size" + parameter altogether. =20 =20 Reducing the memory usage diff --git a/qemu-options.hx b/qemu-options.hx index f6804758d3..22e8e2d113 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -756,9 +756,9 @@ The maximum total size of the L2 table and refcount blo= ck caches in bytes =20 @item l2-cache-size The maximum size of the L2 table cache in bytes -(default: if cache-size is not defined - 1048576 bytes or 8 clusters, whic= hever -is larger; otherwise, as large as possible or needed within the cache-size, -while permitting the requested or the minimal refcount cache size) +(default: if cache-size is not specified - 1M; otherwise, as large as poss= ible +within the cache-size, while permitting the requested or the minimal refco= unt +cache size) =20 @item refcount-cache-size The maximum size of the refcount block cache in bytes diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137 index 87965625d8..e3fb078588 100755 --- a/tests/qemu-iotests/137 +++ b/tests/qemu-iotests/137 @@ -109,7 +109,6 @@ $QEMU_IO \ -c "reopen -o cache-size=3D1M,l2-cache-size=3D64k,refcount-cache-size= =3D64k" \ -c "reopen -o cache-size=3D1M,l2-cache-size=3D2M" \ -c "reopen -o cache-size=3D1M,refcount-cache-size=3D2M" \ - -c "reopen -o l2-cache-size=3D256T" \ -c "reopen -o l2-cache-entry-size=3D33k" \ -c "reopen -o l2-cache-entry-size=3D128k" \ -c "reopen -o refcount-cache-size=3D256T" \ diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out index 6a2ffc71fd..70f245ae7a 100644 --- a/tests/qemu-iotests/137.out +++ b/tests/qemu-iotests/137.out @@ -19,7 +19,6 @@ Parameter 'lazy-refcounts' expects 'on' or 'off' cache-size, l2-cache-size and refcount-cache-size may not be set at the sa= me time l2-cache-size may not exceed cache-size refcount-cache-size may not exceed cache-size -L2 cache size too big L2 cache entry size must be a power of two between 512 and the cluster siz= e (65536) L2 cache entry size must be a power of two between 512 and the cluster siz= e (65536) Refcount cache size too big --=20 2.17.1