From patchwork Wed Aug 8 07:10:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 954797 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=janustech.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=janustech.onmicrosoft.com header.i=@janustech.onmicrosoft.com header.b="pZZ8Hxcq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41ljJB1d54z9s1x for ; Wed, 8 Aug 2018 17:12:26 +1000 (AEST) Received: from localhost ([::1]:42128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnIdr-0004C0-S3 for incoming@patchwork.ozlabs.org; Wed, 08 Aug 2018 03:12:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnId1-000416-Ib for qemu-devel@nongnu.org; Wed, 08 Aug 2018 03:11:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnIcy-00039B-8G for qemu-devel@nongnu.org; Wed, 08 Aug 2018 03:11:31 -0400 Received: from mail-eopbgr700128.outbound.protection.outlook.com ([40.107.70.128]:57072 helo=NAM04-SN1-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 1fnIcx-000386-Ui; Wed, 08 Aug 2018 03:11:28 -0400 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=V9k2+C3jiP1RGH8k4AbfeASoqvFXQEb9J7Fn7SKVFIo=; b=pZZ8Hxcq8JgqZxK4ZroQLM/1NMGJ6AH/F0rMOHtbIov/c038HZcGbQgR5mUSwIlt6UQNduqCyU3QFFRUuutexIujFvnM6eIbB4CIlEG/ZO87Qv9JOeL5yNQakCfJZdPJL5IjIqtEhVcVgOvDqSLzdsX2YOkH1vPztZwAbQyrQ1o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CY1PR07MB2617.namprd07.prod.outlook.com (2a01:111:e400:c637::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 07:11:23 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Wed, 8 Aug 2018 10:10:48 +0300 Message-Id: <20180808071051.30628-3-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180808071051.30628-1-lbloch@janustech.com> References: <20180808071051.30628-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: AM5PR0102CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:206::16) To CY1PR07MB2617.namprd07.prod.outlook.com (2a01:111:e400:c637::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 306462c4-cfbe-4da8-cbf4-08d5fcfe2779 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:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 3:P4etYc6m13axEsX2nvU0Sc0o5upk6dxkNokycLCUiGr3QFhroVox9EgGS+5wRnRXuLwMoBKTWtleZKHAVVRno+a9ucfl+gRB3G4AnzFqKRTrUQJqD/uVXLq8Cxoe7Y1Bo5aL0/fvp2jRfkD5yJBXV5asOz5jQKtxGDqZl+4q0u8GGTLA/lnGQNmCz5TAy900oKt54xtxGYHabRQcFcjUyK+Mm075aSqW0aWtQ/BVXks2sk1BR7nQtnPPqlx1aJ7i; 25:btgQeB9SiHN8uSQspquWvQnvGpFMNmSoImrhRN75Pcy9GS6mO5/HUbVTjzMgU0aReAjkQfAUEyEhqSBNJ9Qmf9YyzqeHFH3Bal1mXfEnZY2hWYDyvMTxOkFSoWaduvht02P5DVrTEc7CeB00w0oqEWe9SBIFA4eQjD3W4TLxQFFtnNjkYv7TQEJ4SSkLiSvSMOrbvDQenMY1IiiDN77pvdweFslrzItPZaDOsZxJCOaZ0gLRzhV11dO6fcmciSMGtrdAVDDpOTllP/Bm84a1C9v1EJJTLc1ennKi4JqzxiwLcPPkk78mGxRHIgfhO+owKJi3ckdUFuxi0Q81loaD+w==; 31:dZU7TLreg+fFlSXYDcKYYL7PgSAn+RVSMVoJQhTJTIwBNo7B2hJVhsbeoSfgGh0D5lM8Jnw7HvS5XPQqLbLDvxhm9p9T2Am+ulKYVxFPSq22ZzhAKzpUNs54jC74fHQFEG8CpgxfDrBMwP8zSWn62NrR/TqhkzN4KgvktpKgL7srWn/+BQ5TAv2f2qDzNHkjuWtI7L7OYNHXY53/w3Wwqv/0/ChIewbBwtqAEii+f8k= X-MS-TrafficTypeDiagnostic: CY1PR07MB2617: 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)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123558120)(2016111802025)(20161123560045)(20161123564045)(20161123562045)(6072148)(6043046)(201708071742011)(7699016); SRVR:CY1PR07MB2617; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 4:evw2mmswE05Eft3TV9EZ0F2fg4kzPtcf6ykZ1eWjFwAyAqvOIecGqN2oLCkJLJ+A/hTdzevKm4FXabnGv/OkvQ5thvu4cH0hiM/ijHgzCcPIcnvGEAlC0K1bJze6E3jtl0pIJ21iJee+8ijnFYGcSoWGywDzCJYdQoNoK5SKv5gA0PzbDlSmWz4olANa0haTJ9RNFTtrYLtlaNINtgey/MoBx2F43bdvP5y31CnDQczSooAJEYvcrckTTsgWJNuC84ZQ4bYWvJtt0xfn1hwrZw== X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(136003)(366004)(39830400003)(396003)(346002)(376002)(199004)(189003)(36756003)(6916009)(107886003)(6512007)(4326008)(186003)(53936002)(50226002)(25786009)(51416003)(81156014)(48376002)(6486002)(8936002)(50466002)(8676002)(68736007)(81166006)(52116002)(6666003)(2906002)(54906003)(97736004)(16526019)(551984002)(105586002)(16586007)(86362001)(66066001)(305945005)(2361001)(2616005)(316002)(386003)(6506007)(2351001)(47776003)(106356001)(7736002)(76176011)(1076002)(11346002)(478600001)(26005)(956004)(486006)(476003)(6116002)(5660300001)(446003)(3846002)(14444005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2617; H:Jupiter.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2617; 23:eQtxFctDCpgztHlJadDqdzCDF/KJPDrKyJuNOU+Qe?= xoAr5fsVlIxmzZeHZUIckf3xMba0oPtHoyggLWYQBdwy1o0y3ppOlRBm3GB8V575eDoK5bs1KFlNlngz/q2hmO2C4Ej/V7KiSF5cYGMbQDSuxW852CwLWqjkpwJzNcET58ofxmJ6znhMbE++LYdRnGgozCBVhamMyQ933eeUlWM0qEJokE5LYGiFseL/6TeSgj8LUOcJ/TSxpx9cvf/EUb+FRCBTc3HlQUrwgxqgo53xj1ife/mCn+Sv3SoZCVGGBlSzq300klLBG5SAkblk9yFHPMWdK98jeP/syDh30BXGIWrhPUejczLOh+fEe5Uzyayl8Nwsl7f0OgFAI2ZBIRSUw6995Sy1r2Slp9J73cfbRzsS5/dqRCViWYVIkwgmuYet4eW2SImxHj3Z9DUONJqjf+6V6utXSf3LlMe1dbAKKH0/PS7uwwVCgCdQUbjacPQ4UVQjcDyd+AuaB00xxvLzu4B+KCPq3VfExuWws64wuH85XtmnU84IYphFVeptjYZDzV1CNe+cOJcZd872pjXsXhdRHsZrxfuIfZJSUeSfw5eEwjH63gGyvxBxQv77pKAHry/it9BGV9LJdVhirRVebDQqOTwJiQE2r74HL6N3GrKl0tBa3FrU6TcFm9V0YrbxcwxQsGl7xlqIxJq8zzTAxDRQYZxE+IpL95D90g1yPoI1M4Mt9iVz8A1UsodKkJywTnYZjrZIzEHMFXz4cnYJ3a/79mg901c1ZUgSVw+p6h2J72fbSMKXv1ze/apbA7qTkLcNRnCKlDfb16rWPfgvu2Eu0h32G5GNL5NxGewaK/U7NdE3LWH4wPb29NOvMBrx3nQeWFBRfODwCOnNIEj8LEynZy+t986naVeD4bZ7cl27rwZ+WgQk85MDwfXSak+8SSdxTxa4ld6sMk3sbyUriiByO7vXnEQ/K2CxYQLBY82nngUQCgV1BsY2UgrXVuuzK5Jyr4++rW7Tw+JMtlm5SZYFbPCfHsJvblvDCtkHBzfTRJaPoiqhB0Vrf+WaKDwMXJr8EhY49qZdf4YpSa08uJ3eWX+0W2H2tpzKvqOs7pSCRAwzoqC15S6FyMfG+lcNYgOkknp5NGR8CNiwpP/boxpG37ov+WmazIgWgnkzBWtuc4aWeZDsyCrKclAtkF/w8yiDpc0j6oKfXkgQZCryDJbrXXrbffPIichfLVJUx9sGS7eeuRoR9Ri0Sg2RDxRJE3GYwE4Vasjyr3zJVT6CaBKo6QhSayju4SNPkcYaifu+9UmHIs06xETWuecKbM= X-Microsoft-Antispam-Message-Info: 9s9KE0sWyDEsfnEm8IeGYwg7rf2z+EXs6SB17SeUmrm363e6Aq2AdvL0rjb/Mjg1WwsHvQk91WRfXVhlo75VLtayKvT2RPyx+/JOlYesWfiSV24UxK7a3mvVkv5RFLtqtDakD5Hk9Z0dtRSIw+fJTs7UVIS8JhhXtJZV3pUd/X3Y2PHotUfyijB73SZwlplFgNgLpHEUgmsyN1J19PJoo7nW5So34WF6AnRP1o6uUHvPTvU5PUWztMwElLXcz44j1hn2K/I3Z3ZwnCHhGNHmSHESza6gBOyH79uRJkDcGBLdA44pfndt5T8zdfNDeqJfL92wRL0os5P3idD9Vso18ePyazVyJQIsi2yPetbfe+o= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 6:rFnDWuKmlsXiBx7cmYaPhCR/vKvcGshXXj2s892QvrG/Ge04PDaWsh294uba/S70oJXg1IO49VUBX2C5tBS0DzoZQfCBleqn6vrsNCNuymdfWUgbX6qbKTftbrpz6KdrNXZbhBrtpD/45NrqpKOijH+YNBheS9VKevU10ItdjbH8v2plGhfeQms9Qv7KaN2agFcm5p5nkBWU0BuiLktTVg77rf78eWzYTzUvMX7omw8ygtGEMR4o9v+vVQANIENXRClRa0O7KdXg6nDCVygQUy7iaUUdfkdBNJTmQd2GjvhGwWeTlX6NqY66wWVPKH511ZnFMm4ersEZP5PIjBNMBkrx1t4B8F2VD8mACLJK7I2BUCP9FtYU6aXu5yp6AEO09Msk5ScjPbOLHnH/21D8r/+YqckEllgVEjf15PWf7+iW+ok2t1utx/7QpUAZY4kG4BfDJjQL8se/z7DGLHg1ew==; 5:DcJAKlQ6wJIQXQVO0SrZlCiNFobrC0BhlUe0O71f640z3SlQfrdfTuqL5pkyCp5f7+xKBjKgm85GIyL2mWA7j2tOOosPkru1otuh8SEZSjxdtPEvtvrZh65UF+n4b4ejv1uu4Xtm5vlwP8KXgTs4ZbbEzwA+OJErpW5bBkpsOf0=; 7:20l5beNyMYKzzw1yj+WhaF/RflJbLsMLY3K2/UA1fn1w2eXW3HDnSG9WTF6E51w6h66bKvy1RmFqppO+nxiHZM8XiCIKxaJ1uoZRs47MEc8sgzAGZnUDYGUuGVu68K+xqgyK2waKOCHCsJF6Db3P9WslKGLYcOLq7Uf+uQti8dIK4ikPz0R9p3CG81soS6xRfvO2UA9kcjuh2G80lRbIg8GnczkaTnohRQyODaELiKPh62KQEREutwsrIBhGySjf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 07:11:23.8854 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 306462c4-cfbe-4da8-cbf4-08d5fcfe2779 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2617 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.70.128 Subject: [Qemu-devel] [PATCH v3 2/5] qcow2: Make the default L2 cache sufficient to cover the entire image 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Sufficient L2 cache can noticeably improve the performance when using large images with frequent I/O. The memory overhead is not significant in most cases, as the cache size is only 1 MB for each 8 GB of virtual image size (with the default cluster size of 64 KB). For cases with very large images and/or small cluster sizes, there is an upper limit on the default L2 cache: 32 MB. To modify this limit one can use the already existing '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 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 | 33 +++++++++++++-------------------- block/qcow2.h | 4 +--- docs/qcow2-cache.txt | 24 ++++++++++++++---------- qemu-options.hx | 6 +++--- tests/qemu-iotests/137 | 1 - tests/qemu-iotests/137.out | 1 - 6 files changed, 31 insertions(+), 38 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index ec9e6238a0..98cb96aaca 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -777,29 +777,35 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts, uint64_t *refcount_cache_size, Error **errp) { BDRVQcow2State *s = 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_set; - int min_refcount_cache = MIN_REFCOUNT_CACHE_SIZE * s->cluster_size; + uint64_t min_refcount_cache = MIN_REFCOUNT_CACHE_SIZE * s->cluster_size; combined_cache_size_set = qemu_opt_get(opts, QCOW2_OPT_CACHE_SIZE); l2_cache_size_set = qemu_opt_get(opts, QCOW2_OPT_L2_CACHE_SIZE); refcount_cache_size_set = qemu_opt_get(opts, QCOW2_OPT_REFCOUNT_CACHE_SIZE); combined_cache_size = qemu_opt_get_size(opts, QCOW2_OPT_CACHE_SIZE, 0); - *l2_cache_size = qemu_opt_get_size(opts, QCOW2_OPT_L2_CACHE_SIZE, 0); + l2_cache_max_setting = qemu_opt_get_size(opts, QCOW2_OPT_L2_CACHE_SIZE, + DEFAULT_L2_CACHE_MAX_SIZE); *refcount_cache_size = qemu_opt_get_size(opts, QCOW2_OPT_REFCOUNT_CACHE_SIZE, 0); *l2_cache_entry_size = qemu_opt_get_size( opts, QCOW2_OPT_L2_CACHE_ENTRY_SIZE, s->cluster_size); + uint64_t virtual_disk_size = bs->total_sectors * BDRV_SECTOR_SIZE; + uint64_t max_l2_cache = virtual_disk_size / (s->cluster_size / 8); + *l2_cache_size = 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; @@ -814,29 +820,16 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts, } else if (refcount_cache_size_set) { *l2_cache_size = combined_cache_size - *refcount_cache_size; } else { - uint64_t virtual_disk_size = bs->total_sectors * BDRV_SECTOR_SIZE; - uint64_t max_l2_cache = 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 >= max_l2_cache + min_refcount_cache) { - *l2_cache_size = max_l2_cache; + if (combined_cache_size >= *l2_cache_size + min_refcount_cache) { *refcount_cache_size = combined_cache_size - *l2_cache_size; } else { - *refcount_cache_size = - MIN(combined_cache_size, min_refcount_cache); + *refcount_cache_size = MIN(combined_cache_size, + min_refcount_cache); *l2_cache_size = combined_cache_size - *refcount_cache_size; } } - } else { - if (!l2_cache_size_set) { - *l2_cache_size = MAX(DEFAULT_L2_CACHE_BYTE_SIZE, - (uint64_t)DEFAULT_L2_CACHE_CLUSTERS - * s->cluster_size); - } - if (!refcount_cache_size_set) { - *refcount_cache_size = min_refcount_cache; - } } if (*l2_cache_entry_size < (1 << MIN_CLUSTER_BITS) || diff --git a/block/qcow2.h b/block/qcow2.h index 81b844e936..d77a31d932 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -73,9 +73,7 @@ /* Must be at least 4 to cover all cases of refcount table growth */ #define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */ -/* Whichever is more */ -#define DEFAULT_L2_CACHE_CLUSTERS 8 /* clusters */ -#define DEFAULT_L2_CACHE_BYTE_SIZE 1048576 /* bytes */ +#define DEFAULT_L2_CACHE_MAX_SIZE 0x2000000U /* bytes */ #define DEFAULT_CLUSTER_SIZE 65536 diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 5bf2a8ad29..c7625cdeb3 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -97,12 +97,14 @@ need: l2_cache_size = disk_size_GB * 131072 refcount_cache_size = disk_size_GB * 32768 -QEMU has a default L2 cache of 1MB (1048576 bytes) and a refcount -cache of 256KB (262144 bytes), so using the formulas we've just seen -we have +QEMU will use a default L2 cache sufficient to cover the entire virtual +size of an image, which with the default cluster size will result in 1 MB +of cache for every 8 GB of virtual image size: - 1048576 / 131072 = 8 GB of virtual disk covered by that cache - 262144 / 32768 = 8 GB + 65536 / 8 = 8192 = 8 GB / 1 MB + +A default refcount cache is 4 times the cluster size, which defaults to +256 KB (262144 bytes). How to configure the cache sizes @@ -121,8 +123,11 @@ There are a few things that need to be taken into account: - 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). - - 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, but is capped at 32 MB (enough for image sizes of up to 256 GB + with the default cluster size). This maximum value can be reduced or + enlarged using the "l2-cache-size" option. The minimum is 2 clusters + (or 2 cache entries, see below). - The default (and minimum) refcount cache size is 4 clusters. @@ -180,9 +185,8 @@ Some things to take into account: always uses the cluster size as the entry size. - 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) then none of this is necessary and you can + omit the "l2-cache-entry-size" parameter altogether. Reducing the memory usage diff --git a/qemu-options.hx b/qemu-options.hx index f6804758d3..d6e15b2f06 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -756,9 +756,9 @@ The maximum total size of the L2 table and refcount block caches in bytes @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, whichever -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 defined - 32M; otherwise, as large as possible +or needed within the cache-size, while permitting the requested or the minimal +refcount cache size) @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=1M,l2-cache-size=64k,refcount-cache-size=64k" \ -c "reopen -o cache-size=1M,l2-cache-size=2M" \ -c "reopen -o cache-size=1M,refcount-cache-size=2M" \ - -c "reopen -o l2-cache-size=256T" \ -c "reopen -o l2-cache-entry-size=33k" \ -c "reopen -o l2-cache-entry-size=128k" \ -c "reopen -o refcount-cache-size=256T" \ 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 same 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 size (65536) L2 cache entry size must be a power of two between 512 and the cluster size (65536) Refcount cache size too big