From patchwork Fri Aug 10 06:26:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10562277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6296C13B4 for ; Fri, 10 Aug 2018 06:36:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 538CC2B194 for ; Fri, 10 Aug 2018 06:36:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 480412B54D; Fri, 10 Aug 2018 06:36:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BC2882B194 for ; Fri, 10 Aug 2018 06:36:22 +0000 (UTC) Received: from localhost ([::1]:54590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo126-0004qs-2A for patchwork-qemu-devel@patchwork.kernel.org; Fri, 10 Aug 2018 02:36:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo0td-0006vY-2f for qemu-devel@nongnu.org; Fri, 10 Aug 2018 02:27:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo0ta-0001jn-Fg for qemu-devel@nongnu.org; Fri, 10 Aug 2018 02:27:37 -0400 Received: from mail-by2nam01on0133.outbound.protection.outlook.com ([104.47.34.133]:54107 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 1fo0ta-0001ik-4V; Fri, 10 Aug 2018 02:27: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=3c1xabaSzmctvDig+pVeJlQHXMMRpmHPpC3D72iLQJc=; b=iIdPqD3kcEqVKmzRiEmxNdv2SiiQGdl8mCIohy12eKSQT94ilQPGzYW2mKKqFXHD5b0g0r6DPCiu93mvzrHOFznsmm3Guz0Cfl2ECaVN13SGQGv4gE54aeOXWwRd8TBotYvQBAFBeGJj4prt3IFXDKi9QueOEVuS8zTZH79J0T8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; 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:29 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Fri, 10 Aug 2018 09:26:44 +0300 Message-Id: <20180810062647.23211-7-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: bac2c20c-f894-4cb3-3df0-08d5fe8a5aa0 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:Oq8asFlWS39yenLRH6FhMAYQ/HnCNbjobj5UXR1Gv2upCNiwTW5r1/olsmbzB8jTisPpHFt+UJFfYCHMowE+3h+wrINvQ7B5pXbxyfwklr/3BNnf1R3b+5H4Gk8Mwmw9+Jkd1SsoF/mIWAbVPHg4S8rYx0dtZFbYOEhWN822jG+jxY/DJoWE/IphwBIPEYwMl/Iuf4pARKuxLOhmfkxWfQnCkhEpLuEzyRX3yzVZDa1goLUsw8xnCFwL866llBgh; 25:h2iwe1Wakk0V6mXPrFGRQW8arj+P7RN7mZ6ErF1ehcmA6eUBunpGnbm2fz1xno3uiHqG8cwPCE9UDUr6JOvKFSumjbik26bQdEgbF70WmftncdYXXbJmu6BkMi+gqi0I6kMSHHZq6PrW+D2OCbLf3w3BeiW6a7e1hBQazLOpYQJHSwocCRku4YfNx9Zu0V13LsUndlpV+twSENe0b6sHAnhWGTDkyUnGm7gxQyaYwoo4bmRpqd15zF8ZAYDVWBgNG8x97LMunPpKYCif0Y2vtRWijeIxdlCmB4mWVEim/po6SDdqiBvm5TRA/i8aWTewY4k2SeOpsQnDW9Qy2+Kzlw==; 31:E70AFVCRO8Xv4QAck1BetWR7HCVgAb5r1iexUCfQPdmdnRDfmsFOAzgY8zvPlEn2tUkj/gKuHutB58hZwkJHucWWxDNGftsaRuZI4AixygQS0faigPidtGQv+l4kYdxydW5h9YMAvu/QF2x/1OVfdxFtpDdvs6RBYJgmWx/7dmTDcSuElJ9SHm0Qm61ZdBvZ9teaO+a1Le6uUfkU0OHNL6cj6yoe5AAJyRQJ5eNMF74= 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:lxT07M0GfgokImUbqbJU7nTKwOeBS1BgICjTqieAbyrWgvQKawjx7pvUJgPSWWpVrXoMtLIR8KIdp+EeEs11twA16mKnrDrhrt+DfqTNqvtzEVuZe+12ZNEpENu3aJQ0P0/nJGy6BRtRjiDtkSLvWnIOnPXuUBb0/hYIqFbSIjUp4hA2WxBOmUk3tlo9z725+EP53ja0twm6e9AKN513w9JHRy1Bdkn0p8PYAButjPEEIJ0tgWpthCpxRioYDXyNUtc8jN89BWywJEMhCWVO5w== 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)(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: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR07MB2623; 23:6rQFh5G3LTRAs9o/Obs4IG13Aw0PahIM/FKu/O6gD?= YZYjwxLqcsBoswppiBd4HR9tL8TaBjY8iJXcHJX8//F/cSCpqvtLtA22JPzrRcIAW/P+pMVEZM2mypz4q2z2mQGW9uChCQ5jmUrTvSmg7cpkMFNY5+qZ48WQMHprXZWHK4Z4tut0p8BJGAJCroWD9Z/xmlPYki/bLITnReh2+k7nqNIXzSfpMQcHmuQqTAwdnd80wkBlXuuN0YT053puA+jJXhUAv6VXO8aoFpNUhAv6DCc4oNp3e8hg2CEXPqsqazn0hEZAp8q+30W9eSD8UPEA+ldjo9AugSLkWs7DrWMspgAnvYYNbSALc8dpWc/0qP7mHX7uri+PQmCnBxz2QgC+fXaLzGB8P5NYMkauKUvuMIkkRb1/KODKcz0lbfgS3bEKiN35GZqvSVEJ3gMbptlFGNS2m6P5hFmV2qeM6dW9iIYdbGKeKmoWg51aLZXETSxu5/KPdHPfnzJoiSdBCBxjhcbxPHlfZ2tcSwFp1Mh0XMl20VuTbQc2W0FKA0acTfViX+Op989R0GT9P1OQ00S9Ofb932Mpf8oeD91i5ZvgyonHb/cVW1LvlB66vLL8da7iJgo4FQUu67aIdm4KD9IE9b/uThs6wz7aZ67rJPV02+FFla5EVV5Sjf7HrBUohs2vOcaFXwXEJVUmVl8FO3zEpWQJ/mDjn6RPRl70MyhNX79fq73VckumF4Yt+7PTQ881cGLq2bW7LPz2Ce0y3xtN0y4YE+qXkCWqf4wQbuYJtf7QH8b/W46EWs4ZmMST6FjJ4cEkrKOX3z8kzCujvMoEU2yIZ/wfpjxdLh1QqZmg6Gz4NrO82JpHdr60gIGxyrgQHUNf2KyLxKhHgmsc391XkwsyjdMTmF/CZmHfHwMfo65zQkHr6Gh2LmlAyhdbnFWUKo4ZlsC7nHEc/B5FQPc7PRGzNDE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DbmPBxL2aBvghis2obl/ud5GzDDkLgHs9DrALHwdXSl74LpBv4CTgWooYT+M3M8zV6Aa8HzzIy2fu0sCMEf9VFBUiPi2D7GcsGPhlNThY2X9IDUqtYIyBt2XzFy8E4kg2pgcKDpcrfphYRIbhhYfpIc68FVg==; 5:HtKVEXX3c/TWDzNfq5Asl0fwimo4OH5aub1QrlQ1hgMyPLWbGW2ckJCa/hOZ6GtAJx7Sf9FLiOH570Q9WkuZUpr0L5/A/Q+vjbNdqLeuOxbqmv2gzTbN4vUcor75C8zW3DwtkhO7ntKmBSgr9KplH6ow7NWu6llZxK/simcGg7k=; 7:c5qeXfCZbQiI8k6RYhRMGq9mTGQa+/IAHzDacPLmnu2/vWYOoGcZt0B9VjCv7U+Ur7KpTAdCNKQT1VQkSYk8wVUamfKq3Ez6Inxgn9o1iykyx3eDksKpDsjIebAVWj2J8y9jhEjzXejjp0BppMRh5wPGOIKkEDAlGqk83ZiOLeNbrxNrsIrBOvcsC1Tki/Umv4cztQxyBFEjt+cmFZGkjqUBMJTNwNWZTCaL2X3ZS+o+YV8XwSdY3F2DjpdVujjZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2018 06:27:29.9373 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bac2c20c-f894-4cb3-3df0-08d5fe8a5aa0 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.133 Subject: [Qemu-devel] [PATCH v7 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 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 Reviewed-by: Alberto Garcia --- 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 d917b5f577..e699a55d02 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -74,7 +74,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 (1 * MiB) +#define DEFAULT_L2_CACHE_MAX_SIZE (32 * MiB) #define DEFAULT_CLUSTER_SIZE (64 * KiB) 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)