From patchwork Thu Aug 9 21:53:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 955871 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="UE/JU558"; 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 41mjNt0KPsz9s47 for ; Fri, 10 Aug 2018 08:19:58 +1000 (AEST) Received: from localhost ([::1]:53187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fntHf-0002f1-M4 for incoming@patchwork.ozlabs.org; Thu, 09 Aug 2018 18:19:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnstD-0004RJ-1M for qemu-devel@nongnu.org; Thu, 09 Aug 2018 17:54:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnst9-0006eC-0E for qemu-devel@nongnu.org; Thu, 09 Aug 2018 17:54:39 -0400 Received: from mail-eopbgr700129.outbound.protection.outlook.com ([40.107.70.129]:34372 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 1fnst8-0006d4-Nm; Thu, 09 Aug 2018 17:54:34 -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=D33CEUHZRyA39E3/K21wnojuniyTTgQaelwlvPSfSl8=; b=UE/JU5586ooDl+9qA2Usw4FPOskBH8K0JyaG3vHbpmQq5g+GFGmOM4cMe7iHJVyMzp79H0go4nktmJasdd/yu6HgZbhPCKuQuLfH98OPBrwTx/Rj2oTR+SbAsLcs5thy926NEwOKPt00letNPO6jS7Wt7RlcDDMGodmCDhykfjw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CO2PR07MB2615.namprd07.prod.outlook.com (2603:10b6:102:14::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.23; Thu, 9 Aug 2018 21:54:30 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Fri, 10 Aug 2018 00:53:04 +0300 Message-Id: <20180809215307.18241-6-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180809215307.18241-1-lbloch@janustech.com> References: <20180809215307.18241-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: AM4PR0101CA0050.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::18) To CO2PR07MB2615.namprd07.prod.outlook.com (2603:10b6:102:14::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a0fe77fe-13c6-45a0-9ea2-08d5fe42b07f 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:CO2PR07MB2615; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2615; 3:1msJl1IOdOLdXutpb62QYBBO0SIG4GgXVi0AFz3xhS3c9D1tq0128ju5OhofzprOmsvkM25Ofzj7X8/S7XQOnIdSAMDD4x2PnES60l+nHTlaO43AV3G5cQV15at7ClCXhOPlloqo4np9sjnHkvo9jXxIt3F0FQGEqb1BLaDqtBjNM0QVYEW8qNcZr6tXpuhw7Nng4g5S0ouwrI/CXw8Q2gWlq4cezv3UeRfb1aRgcpI+mwcjlOlr1MzufRwSzHaO; 25:YoGdyqSlIqj2FTar3dm5fXGzX7D6F7FeIOD0ngng8naNVOcZ5+suHuhjpPS27zoJxC2szNn9zOEQgT+NpZMP1XHBn0O3OLKtUZvGwMVXZmWEwywY29SqIxY0U5Q+km1QyvOwwjgE27RAKWA/MaIyHAHURvjcMAq49ug+q70d7w0c4dWsDngXI5tPOjLgv+qpuonUwutZMqH2ILrNvQRnXFvREVfU+ywfzK0muZlvjX+cbuyCcrheY0yGVtLIljtAAURvt8W9+D31Vm9/LFbDi+1FEd0soqYwSqW2N82bZj9ZbD/+K4ladrMqWwEPNTFgfjjAvRPldKCZYUzvX35hlQ==; 31:wmivB4Zye6b6hYA8sD88pGmIKFnSWMBqjjdc/NYyp0EeVmfL8dGXQHRPN6Q0CuSZtmGdaaN2GfPcGs7avSJzprtI1paFlAtdJ6PRNGi+6EwZa1mmK8vWtq6uSx7NcPe0OtZ4M7iXviDdTx8o0p68AzRvg/HVw90uVxJ7+mLs2SrJPAPcfkAv+T2FA/Nx4sPQo9Sxv2eFvzntZMfu/6TJnAV5FneEvX5EtYm0pCZODsE= X-MS-TrafficTypeDiagnostic: CO2PR07MB2615: 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)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123564045)(2016111802025)(20161123560045)(20161123562045)(6043046)(6072148)(201708071742011)(7699016); SRVR:CO2PR07MB2615; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2615; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2615; 4:6Qi/pE49Ep04EFEO+1OmEkD6W+0ZjBnES+Ikh7jSvmsSV20mYXU99uhPAZOF2fOwvjtG0NVf8Ge1RvytX60z2hZZ2fQOGY9OLPQitWDLcSIJW3QIERrquUVTC91dvrzk6C5LLfSzukVGudrijgCnmHqBh++ybBLvjLzSHDiywe3QmTNZytTbBS3vVqoq8qDYS4jP4aEAmmGuynyvxO9x2dAcGS0KnY6yx1NJ1FoFYYJVBSLy35n4iDInRLmiUvpeJs1MdYivj/kqSyy1y4t72g== X-Forefront-PRVS: 0759F7A50A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(376002)(346002)(396003)(136003)(39830400003)(366004)(199004)(189003)(486006)(2616005)(16526019)(86362001)(6486002)(7736002)(8936002)(16586007)(48376002)(478600001)(446003)(81156014)(68736007)(81166006)(186003)(476003)(26005)(305945005)(386003)(2906002)(8676002)(50466002)(50226002)(14444005)(956004)(11346002)(25786009)(316002)(52116002)(51416003)(6116002)(6506007)(1076002)(3846002)(5660300001)(105586002)(6512007)(106356001)(6916009)(47776003)(36756003)(2351001)(4326008)(97736004)(53936002)(107886003)(66066001)(54906003)(2361001)(6666003)(76176011); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR07MB2615; 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; CO2PR07MB2615; 23:KiE3bPo3SkhNV6YjuajggjPG0ApH09MA8ftQxuYm0?= EweoY9X5X9YReICw2tX1xYqf4QO7Z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y7ZT6WRS4yqfAple8r6gmWPpaBXTlUYXRWMKqH4W/It/ILaoikbyXiXouWapikyV46mFYMhSLyUkblDjm548+kf7yMaBnFKhw0uUjkDsO/G5UNLmWNvEQupwIqsz16rHeQ51pMzMtbRkwE3FC59ug=; 7:2+Poh/Sn+YX+yoVYSrjPr3atOPsRewvpM1lcEy1ctjFff9eEOwtqN3gqgPvF4ewVb9glB9Nb6P1HKksiw2hV6UIkfIfyOzm2tnYeNfi4qSQKg6u+vfSdj08COb1r+dUZERP4CSGXBKSD+rrIazBM05Yem6L5D1fczdyDvlka6ua0KEOnXiJ5r1Ujm3aYJAO45UO17nWw7KTasKFOETKgEPPTDWre9pF5MfLy9F9T8shVPn70kCnrZeE4a6tL29ZS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2018 21:54:30.5005 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0fe77fe-13c6-45a0-9ea2-08d5fe42b07f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2615 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.70.129 Subject: [Qemu-devel] [PATCH v6 5/8] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The upper limit on the L2 cache size is increased from 1 MB to 32 MB. This is done in order to allow default full coverage of an image 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 requires it to. Signed-off-by: Leonid Bloch --- block/qcow2.h | 2 +- docs/qcow2-cache.txt | 6 +++--- qemu-options.hx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index 0bab3d8b94..d77a31d932 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -73,7 +73,7 @@ /* Must be at least 4 to cover all cases of refcount table growth */ #define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */ -#define DEFAULT_L2_CACHE_MAX_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 69af306267..6ad1081d1a 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -125,8 +125,8 @@ There are a few things that need to be taken into account: (or the cache entry size: see "Using smaller cache sizes" 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) + image, up to a certain maximum. This maximum is 32 MB by default + (enough for image sizes of up to 256 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). @@ -186,7 +186,7 @@ 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 - (the default behavior for images of up to 8 GB in size) then none + (the default behavior for images of up to 256 GB in size) then none of this is necessary and you can omit the "l2-cache-entry-size" parameter altogether. diff --git a/qemu-options.hx b/qemu-options.hx index 22e8e2d113..4c44cdbc23 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -756,7 +756,7 @@ 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 specified - 1M; otherwise, as large as possible +(default: if cache-size is not specified - 32M; otherwise, as large as possible within the cache-size, while permitting the requested or the minimal refcount cache size)