From nobody Thu Nov 6 08:35:19 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) 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 1537551150652998.2637514049591; Fri, 21 Sep 2018 10:32:30 -0700 (PDT) Received: from localhost ([::1]:56748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3PI5-0006BN-A1 for importer@patchew.org; Fri, 21 Sep 2018 13:32:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3P9u-0007wt-Tp for qemu-devel@nongnu.org; Fri, 21 Sep 2018 13:24:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3P9s-0004D9-3g for qemu-devel@nongnu.org; Fri, 21 Sep 2018 13:24:02 -0400 Received: from mail-eopbgr730091.outbound.protection.outlook.com ([40.107.73.91]:48030 helo=NAM05-DM3-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 1g3P9r-0004Cn-TZ; Fri, 21 Sep 2018 13:24:00 -0400 Received: from Jupiter.local (141.226.29.227) by CY1PR07MB2618.namprd07.prod.outlook.com (2a01:111:e400:c637::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 17:23:56 +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=hq7Y39ay4+tmKH3XNGWuBvnQzMTyNsgM3UShWGP7rvQ=; b=L+4mXYhTBuelanDzE9JQJxjdd4iOjBcu8+60ffM424bFtqTBJYthN9cm8YGkuzF1/ihWQ+hoqhPqBaeYLSminxGH4tfkcgjW4ba+58Kk5K2DJuxEOJ5i5jE1bAcskQOdJMu8vclAS+tXfXkSAcD+VFFbx2PwfkFWELxyqikmZTg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; From: Leonid Bloch To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 20:23:07 +0300 Message-Id: <20180921172310.10068-7-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921172310.10068-1-lbloch@janustech.com> References: <20180921172310.10068-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: HE1PR08CA0065.eurprd08.prod.outlook.com (2603:10a6:7:2a::36) To CY1PR07MB2618.namprd07.prod.outlook.com (2a01:111:e400:c637::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbf6b5af-6166-4f0b-5bf6-08d61fe703e3 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021125)(8989299)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2618; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2618; 3:CpadpiLQyNT4LfFF2Ip8EnFlJCFo9zKoZye5t4dF99tqC6U8mfDm27+fWwX5IpsssI36NtovwSfyPUhfQeIIH301pa/IIuA2dXlzsAu9c08Y4G1aK19WB1JvnN++3BopojSe5DDdfNaEqMdfxAk6wVHPljgXXuHWK98ILJiujn3I0U24KaF85mu6NUq7h43KE/eVrmuMe/j7eYsKZZQXw0VSNpOf8WZ1FqnIUj9DEVVLVFxqRQd95yqwjPpbN13e; 25:3fM2LJqncabBnpzJvx0G660WO4dEYgGnkFiKXalIqav1fPGlh1c5i1R+jzlwU0GiNH/xEDc4YRuXJeY7oS4otgJwQmarW+pM52bsMTFqxR/+0qN6fSL0zWiKMNAZJiHTnxk6ADN9dNtcL7CaD51xzkBN7wUixmqXKGtg8JUtblrs7Z7Tibb9Q8sLhMz5VRgumqk579yNZDMe9eh0EEK1Xno04rNIFKHBTlZEEv8gcxaZKi6J10cu7QTIQ9X1ZVPdYtb3qhgz3IqPNycY/nUw75uBh9DNYNjn+boOi8nPqgZyEHcvz+MKWly9vFVKFsCc4ifsRWuIQSOkXThorFzVTA==; 31:tpm3qX+T0wWbCmq9HS/Pu5373R5CIoLUq3wxVu5YKgi1Q1xvdmCo4JrcUZckyT7bjgFtRRkj0gqcxKmBF5VPbU4sy8t/ihd9EmXWEf/lM1GZuV2vGR45F7pbekrvYYasOBjC/BR/A1TTvrnWobtVOLJXCVJgnceyXfiCDdO8Z11v2+his0JsEdLNW5+iSBt1soCFX3yHYIztDjxFUIvd3ETNax0oCqUMsDa9jw9P25I= X-MS-TrafficTypeDiagnostic: CY1PR07MB2618: 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)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(2016111802025)(6043046)(201708071742011)(7699051); SRVR:CY1PR07MB2618; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2618; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2618; 4:3f32TZBEsEgR15vyjv6hZJ/J981km74SVd8uQi1r1HGdPrCmiuc+O/4TOUs36Yc1v9pkUepoRzx/cVfUVouZhe1EBLudFRbDlgI9xY/0TKnMXUzzpyxcdsULGjQ1sPk+emYcaHS7F21M5ct+qvDZ8M/Rx+DsTDF+QOdIt4pUXSd+jZR8cdQtrI9RpBhCDhiex27hyt1fcWEo/VGeZokHLs3jz9ckAwvtVpKTnXJ++AlFNhZHiCe+HD7LHdq0ubAJIcedlEUcG9LbnumS5FOmuQ== X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(136003)(366004)(39830400003)(346002)(376002)(199004)(189003)(86362001)(68736007)(50226002)(106356001)(8936002)(1076002)(2906002)(6116002)(4326008)(53936002)(305945005)(8676002)(7736002)(5660300001)(81156014)(25786009)(3846002)(6486002)(36756003)(6666003)(107886003)(6512007)(14444005)(11346002)(81166006)(97736004)(508600001)(47776003)(105586002)(2361001)(186003)(51416003)(48376002)(6916009)(50466002)(486006)(54906003)(476003)(956004)(66066001)(6506007)(2351001)(16526019)(2616005)(386003)(575784001)(316002)(16586007)(76176011)(52116002)(446003)(26005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2618; H:Jupiter.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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; CY1PR07MB2618; 23:+pHZTIQ1PM5BVIdiqkhqzT0pfSpcpI+QuFT2sTA0K?= =?us-ascii?Q?ancUqsp5zX1J2FmES68FE++ONOYgMY2W5c0KLfVF956UWQ9jBawRMu7cGZ4X?= =?us-ascii?Q?E0Qb/IZFxUooBJP3hGmPXs2YWQDkUAFmJXeEktlFdhZXuGBIM+4i5IjITr+D?= =?us-ascii?Q?7BuJ7An/Qo43dvlU1rugLxV+d/9MYkjnK0oKKBRdevTs+wvHqfB7WSs93QUt?= =?us-ascii?Q?aRv0BOd4smypJIdxZfHHxSgfYf2HMOCLLN8SO4UMS7SVtn6JxZYe5YhIZ6Lf?= =?us-ascii?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Ip2RJj+U2GZ1mxk2JCj+fGiyT+A==; 5:bD6lP/9NHXuXLYoJDQuITDliQXZW8acPXxArq01EN3too8XsjhMhQoKQBy53Z0K/13Vd4ZS0koJ60/r4WCTVBEFLltAunmvoMVeq6wKuDe8fRJPC6mzTWEFu6WTVlld2qahA5KsxpHS2WztJRPTP3wjDEXQoF00qdFrE3Oz5jho=; 7:cpmScJOZH1W1Ginj4UUkU37xGqMbBeSfPtOej0ySYSvO3YRQ4r0hlIgU9Yxf09zY9Ngsj6LwY6vUqo1xaLecl3jloFl6xBvx+0p7RbQGeFbFnX/7W7FEbv4IXR3g3+Ajos1T1znMZM/0vm905KEQbqo4TFVjmk94CHQNYdZ2xpLWDyLghT9fKKDXB7N51t9onBUq7fCxRJyEkabKDk+irbUoK2c2bSLsVnH/jru3HSRIJF9IvQCjGOLH/Dnisuqb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 17:23:56.0298 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbf6b5af-6166-4f0b-5bf6-08d61fe703e3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2618 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.73.91 Subject: [Qemu-devel] [PATCH v10 6/9] qcow2: Increase the default upper limit on the L2 cache 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_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The upper limit on the L2 cache size is increased from 1 MB to 32 MB on Linux platforms, and to 8 MB on other platforms (this difference is caused by the ability to set intervals for cache cleaning on Linux platforms only). This is done in order to allow default full coverage with the L2 cache for images of up to 256 GB in size (was 8 GB). Note, that only the needed amount to cover the full image is allocated. The value which is changed here is just the upper limit on the L2 cache size, beyond which it will not grow, even if the size of the image will require it to. Signed-off-by: Leonid Bloch --- block/qcow2.h | 6 +++++- docs/qcow2-cache.txt | 15 +++++++++------ qemu-options.hx | 6 +++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index 2f8c1fd15c..0f0e3534bf 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -74,7 +74,11 @@ /* Must be at least 4 to cover all cases of refcount table growth */ #define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */ =20 -#define DEFAULT_L2_CACHE_MAX_SIZE S_1MiB +#ifdef CONFIG_LINUX +#define DEFAULT_L2_CACHE_MAX_SIZE S_32MiB +#else +#define DEFAULT_L2_CACHE_MAX_SIZE S_8MiB +#endif =20 #define DEFAULT_CLUSTER_SIZE S_64KiB =20 diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index c84cd69cc7..5965d3d094 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -124,12 +124,15 @@ There are a few things that need to be taken into acc= ount: - 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 maximum L2 cache size is 1 MB by default (enough for full coverage - of 8 GB images, with the default cluster size). This value can be - modified using the "l2-cache-size" option. QEMU will not use more memory - than needed to hold all of the image's L2 tables, regardless of this ma= x. - value. The minimal L2 cache size is 2 clusters (or 2 cache entries, see - below). + - The maximum L2 cache size is 32 MB by default on Linux platforms (enough + for full coverage of 256 GB images, with the default cluster size). This + value can be modified using the "l2-cache-size" option. QEMU will not u= se + more memory than needed to hold all of the image's L2 tables, regardless + of this max. value. + On non-Linux platforms the maximal value is smaller by default (8 MB) a= nd + this difference stems from the fact that on Linux the cache can be clea= red + periodically if needed, using the "cache-clean-interval" option (see be= low). + The minimal L2 cache size is 2 clusters (or 2 cache entries, see below). =20 - The default (and minimum) refcount cache size is 4 clusters. =20 diff --git a/qemu-options.hx b/qemu-options.hx index f9fe43a4dc..d5f4bcadd4 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -746,9 +746,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 specified - 1M; otherwise, as large as poss= ible -within the cache-size, while permitting the requested or the minimal refco= unt -cache size) +(default: if cache-size is not specified - 32M on Linux platforms, and 8M = on +non-Linux platforms; otherwise, as large as possible within the cache-size, +while permitting the requested or the minimal refcount cache size) =20 @item refcount-cache-size The maximum size of the refcount block cache in bytes --=20 2.17.1