From patchwork Wed Sep 26 16:04:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10616129 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 CCCE414BD for ; Wed, 26 Sep 2018 16:14:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C265F28CE0 for ; Wed, 26 Sep 2018 16:14:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B62B728F89; Wed, 26 Sep 2018 16:14:37 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 CA73428CE0 for ; Wed, 26 Sep 2018 16:14:36 +0000 (UTC) Received: from localhost ([::1]:59658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5CSR-0002b5-Lj for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Sep 2018 12:14:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5CJm-0001vb-RY for qemu-devel@nongnu.org; Wed, 26 Sep 2018 12:05:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5CJl-0005kc-5S for qemu-devel@nongnu.org; Wed, 26 Sep 2018 12:05:38 -0400 Received: from mail-eopbgr730130.outbound.protection.outlook.com ([40.107.73.130]:13864 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 1g5CJk-0005XJ-Tk; Wed, 26 Sep 2018 12:05:37 -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=HI0QYFRodMKgi7/VWv07Mv2othK0PnqKtoqIPjyVRXs=; b=W8DK5Ed3bBBR8si2x4qws/BEmvx2oXUL2XQoj8UDwQWTJt/608JcMsLFmNY8Gf8uxHzxZojWg/iT2rysBN0TQ7prBhesoarJpCISbE5KctidDlANP8Zet1jCxDxPmT0/IGoM9aM+Dqg9agYSZ8qFcTFqwrJLTI4vefg9/sJv50c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CY1PR07MB2619.namprd07.prod.outlook.com (2a01:111:e400:c637::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.25; Wed, 26 Sep 2018 16:05:30 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 19:04:43 +0300 Message-Id: <20180926160447.5149-6-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926160447.5149-1-lbloch@janustech.com> References: <20180926160447.5149-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: HE1PR02CA0116.eurprd02.prod.outlook.com (2603:10a6:7:29::45) To CY1PR07MB2619.namprd07.prod.outlook.com (2a01:111:e400:c637::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be6e54c2-7084-4a43-30bc-08d623c9e34d 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:CY1PR07MB2619; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2619; 3:+V6LJuajSRhDltjQKhbxcixrBzs3iZRBO+dMWi/lIwnbKtst+/n8daj0QqPQyESiD2twL6faWr+HbPF9AAjIPrSSk41geK/N7HCR/BTl6H+nqFhtR2kkckxzfcXDK4UIceB2ObQ2u4umnFHldPdTy6cAjVbHQ4ZapiAbo23i67HeJXotB+tEavLpa4gToA11htt5cn8wW8ipexAY747qGVdBdpIv6n3HDlv10ojEwYbJVp05pKCEpclIU5wR2y9S; 25:bl2TES66IExxf0ncYS5vFtVIjxBlP07gceWKzD/LoXoow18voEa1+8UmxOhaoXiFwVfx9hqaOq5zpSQPUzVua6VoATKhELSkcVtF7KiKhU/FWbrZo582oe6F0HUhK+dCSUZSmDyvOkprqXGW4CjUGyKoxltBtb/817LUgV/up7Igc3rXIHaaNJZ/+MheXPoUhaim6r1I3vtUbRQLptjaFI73d3VBrhYnNclk27bPY4yG4Q00X/LeAh+K7xzjXoYeWkitzSa474Kfo8xl+O+CFlHFVNhLH8zkE5wkDovoa97NIJKhiGcga+05XW3ZI9ae4fFgU/CNUYP5gZb12Ywyaw==; 31:GMX/3scX4IAoExZPq87Bpo7qHx8Ai8+bCAsk8+ywRRwaBHgn1SfWU5oQIOce8Idxx3lvnWRSPMmYk/DA2rqsmucU1QmYCeyZCpYblWhhq/PWA6MjhnGpSx5HSheKLVxGa0l6xQthufdWBE2OutPhp1eMB6pgC2Mf99RmO1SdP4jK064sY9mcGbXSSfm77ZLVr+h1o2w69Clc/IqdGJd+Iw/SyJl2h90Yrkg/bnEP5K0= X-MS-TrafficTypeDiagnostic: CY1PR07MB2619: 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)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149066)(150057)(6041310)(20161123562045)(20161123564045)(20161123560045)(2016111802025)(20161123558120)(6043046)(201708071742011)(7699051); SRVR:CY1PR07MB2619; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2619; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2619; 4:QunY/vCdF2L8GlNZOUjo60UPeS1qSqjslqSSQ7ICIA3rtLamDzWCkOS13oaHB+tp21kt8IYtK4BKaJoEGuXe0GdN1/eUYZH3B6MsJRmZCkL/JXJM+3fboolTG5o6QhEqo51uBTwzjZRe8/Evi6C5Tu/VzPD42vzj419ZdxvWy6ZXviDGafV2Gv5oQASSLxdVryhYEo+MwJKSd+PLnLKgMST6BX89Nu6VSW+Y2BlhvAm80OPx7VPgCXyqfvfPYCkhegUGhfXkf2ffGvOFBsTX5g== X-Forefront-PRVS: 08076ABC99 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(136003)(396003)(39830400003)(376002)(346002)(199004)(189003)(106356001)(551984002)(508600001)(66066001)(6512007)(47776003)(4326008)(48376002)(2616005)(107886003)(446003)(50466002)(956004)(11346002)(36756003)(486006)(6486002)(476003)(2351001)(105586002)(34290500001)(316002)(16586007)(14444005)(54906003)(2361001)(3846002)(6116002)(6506007)(386003)(1076002)(51416003)(52116002)(76176011)(26005)(2906002)(305945005)(8936002)(81166006)(186003)(16526019)(7736002)(8676002)(81156014)(6916009)(5660300001)(6666003)(50226002)(97736004)(25786009)(86362001)(68736007)(575784001)(53936002)(551934003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2619; 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; CY1PR07MB2619; 23:ZwPMSbAMKwKKEGbEUrfGPzeykJBrPYx7J+wxlPFyK?= QlGmINaBd71maEWGVqadJJ2i/9GvuJUlnSgqwUdiO4ihwxNgeuyiRRYQ71b+q5yUO38VeZMY2aKhuuWAcAw68ChycN3hnhD3qFDzqrOqLUELVLfgG8mCwTZccSA6sSUSeptF+H/XXiD8iJowNd2JNZJp1O3b0xyKV/NKhS+jF938Y9Po6zBtgpbfwTz9J52xYYTDoMpt2ufAcxHsGtUBQ6f/bY0vnvLa1rVK0vLzhofO54D/vqsIPuNwFV5zdymFrtzVRjIlY9PMmIPE7oIbbYVjynPRzV7THXRji1Arvm6+Ts1bSTi8/fdyqr9pcvrXGyb4x3JUkTOEfWax8C7mGfn3Y8HpDHZ0wTYaaVbv2zcVnlUmwwwFam6I69fCob4Dw/yK0VyotQgbPicMyUzxdeto/1pV+3ARbEmx41ZJOCAgdllwwOl3wgaaTgAxMknthSBeXGBVAzB6SXcsrvvlfru4KpUebRcVKQRfbIPwGuX6j3+XmhkqkwetJwd0xpJGohMVZsMB+xWrT9UkIdZB2VTcLvRB7Az7Z5/XSpMumWoX+xxGDEoSbjJ7I7UVfQOdGEgokyKdsGcSUJx7OW8oWb8StRCyE0Qr3YreOgYFbwUMzYJwvBu197nyqL8xXH9GvdxOIPI6nt+C/SvhqdTCrnGCc4zs8zeOETKzhzT+cARkV++kejvPOHnNtj4m7IKv3eXIKJG9a+ho5In9cPKK7YwsqsbLrvm4zkhbLUE2fvS6hpitYDzUzw3GRr0d5dafgHiNK/dpjQJ0g/QwVPj8HY3OdaqBgxEaJsQXNTsF9DfdPzXdzz/WNiEDvrubSgUYdCEgQ5+lA7mGgf9HeuGasRKIw/3FoW1Yf6Kmey0SbuQB/K2EL6sEHL6tnNg3dInU5un8WeHJUTyofImGuM8u80u3llNohjmRng7M2oVIua2bbWCPLW9Cx20z3sNkTSczAKCtOJ0Quc6tq6VnGxAaAy9iwvw94RuhpWXuMkT/67S00q27fcK0w1DK3yKlHaE7rL6KFxsfMYjSJ4SDMM1hjwm0eAqTirq3CUVsE7l2ILjKQxSj0khYN21FMkhCswxAt4sY43H9hvx1BPxHQwNX5xykgSD/hSJpXYyYCbg87B/itSAdj57VlSfH//Ap3eMJenlRd8jkU+7w3ax/b3kc6KnUyh76f9iztHIC8HIFpFIFHdhZ1iI4rs7NS4dSyf5TYCofrqF6NpFX9IBvd5NEIzNKAMlE2Bigbf17dxL3i02loWHmOThUfVrAfCF349kJRoNEjR/HdQcxjjZzRyBPr8Y5L0g/ukWaboaD8hZCOsq5IqaXgbThXgptIjCS9Z1aBw= X-Microsoft-Antispam-Message-Info: QMw4GinxSAHMpI4ui0MAQHmxZ0mrcIAOE3tzywp9OuWUUV6i9OQuJDNoYdCIJrTSAXUzbHCTEhlOLUmA4PpxxM9iG8FIcNAtQEUnzg8/DLWwnF6D2/n7sGDdVzucYUzHYf4jHUt1PMhvtT1qu8VuX9gavHkukPhpE3PBfTY3V0NhKI0bat/UmBtSnhMbcOKonHZzskB+km17FivPpFgxTAQ0Uft54KSFUCCNO3nGGZ/35ShpXZCR1Db4bbMrHMhdfYonn2Ir9+tJWhTa3Up5WqoT7qypqvGo6lEiXQHA+rKeZ/QU2IsKxA65d9V8F/OKFwmpALJO+53Je+gKUJoE3OdoYQ1VVLVI/WSJmTrSvGg= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2619; 6:YPoLwwAFEeKObfLFBt0Db7Lye50jhiwnLuPbYy7Z4HGR/a3PH8SpbdcM2GaPKuSHvgpdikj6RC79IKNJfZjeQRgx/nUg4muv5ngHF/LBDIhsaIj4M5wIlw5VKXw2p6+hACadAb/yU618sjHL7s5jQOSqJkP3p92afcGIITB6dTMmui9523sF4enu5/QceXpLKi4mXsrNcYvA6WB3VsUOJzzqPuR0UZ2BTl9Iocq4ZQbfP5LUo4fLbftYSJl1arN35ohDFIJ7Qk4fJvkBdYVc5W1oiof2r4tJNR5DXGw2FXyJQs/EeT4Yw8l6eZ7HnnOR1Sbd+N0+DDqR4XFhE1VAtSMlFi3xdbiYxd1mN5x63DkvMPVYX71zBuyfT/coqFWWh7gF9uC6yno0YczDYi/r/TwUPrekoCk0iVHH2nG3PC21w6RYyIjvwfjGDY1rR+DKIj2rRVWmGUwjTtYB1jO/LA==; 5:fy6h9SNqINR5LIm5idQyJskGcd6/Ts1xtMCmROVHk4JLRbFORi/JAc9lhOAoW29/IkXa2UGDvj/V9cDeus4jgRP6GZ2yovV0IztlJqoMtIWznx1h9WVKVhS8RSiD6wHdWYHeO99e6g26GEnyVpoc7MI0mG0g6S8nyY2tjhycOzg=; 7:gAc8ircOSEkT6D50gtJNISK1LQvcyXjM/OCDyH5oRmzdketcyUIs5TrHJMv2Dzt8APKL06sdcjRKvQwRCP8K8YkpHnREtOlKu4ETuKXET0egSJAB78zVcSMbcY1cLsH3yIqc8JsMM9jJxVs78bQpf+cBOUyaWnV3vLum1rdCZd2oZmwcMHgFWR2+zNalCUUiRtMA/5U0zQZ6X8uqXOO71FxupdRkckxSSasxU/KQ4KXTbYPUU+PP5+3ocCtNnUbz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2018 16:05:30.6070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be6e54c2-7084-4a43-30bc-08d623c9e34d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2619 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.73.130 Subject: [Qemu-devel] [PATCH v12 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Sufficient L2 cache can noticeably improve the performance when using large images with frequent I/O. Previously, unless 'cache-size' was specified and was large enough, the L2 cache was set to a certain size without taking the virtual image size into account. Now, the L2 cache assignment is aware of the virtual size of the image, and will cover the entire image, unless the cache 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 Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/qcow2.c | 21 +++++++++------------ block/qcow2.h | 4 +--- docs/qcow2-cache.txt | 15 ++++++++++----- qemu-options.hx | 6 +++--- tests/qemu-iotests/137 | 8 +++++++- tests/qemu-iotests/137.out | 4 +++- 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index cd0053b6ee..589f6c1b1c 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 virtual_disk_size = bs->total_sectors * BDRV_SECTOR_SIZE; + uint64_t max_l2_cache = virtual_disk_size / (s->cluster_size / 8); 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); + *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,9 +820,6 @@ 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) { @@ -828,12 +831,6 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts, *l2_cache_size = combined_cache_size - *refcount_cache_size; } } - } else { - if (!l2_cache_size_set) { - *l2_cache_size = MAX(DEFAULT_L2_CACHE_SIZE, - (uint64_t)DEFAULT_L2_CACHE_CLUSTERS - * s->cluster_size); - } } /* l2_cache_size and refcount_cache_size are ensured to have at least * their minimum values in qcow2_update_options_prepare() */ diff --git a/block/qcow2.h b/block/qcow2.h index a8d6f757b1..2f8c1fd15c 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 */ -/* Whichever is more */ -#define DEFAULT_L2_CACHE_CLUSTERS 8 /* clusters */ -#define DEFAULT_L2_CACHE_SIZE S_1MiB +#define DEFAULT_L2_CACHE_MAX_SIZE S_1MiB #define DEFAULT_CLUSTER_SIZE S_64KiB diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 7e28b41bd3..750447ea4f 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -125,8 +125,12 @@ 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 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 max. + value. The minimal L2 cache size is 2 clusters (or 2 cache entries, see + below). - The default (and minimum) refcount cache size is 4 clusters. @@ -184,9 +188,10 @@ 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. + (as explained in the "Choosing the right cache sizes" and "How to + configure the cache sizes" sections in this document) 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 2db6247eff..6eef0f5651 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -736,9 +736,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 specified - 1M; otherwise, as large as possible +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..19e8597306 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" \ @@ -119,6 +118,13 @@ $QEMU_IO \ -c "reopen -o cache-clean-interval=-1" \ "$TEST_IMG" | _filter_qemu_io +IMGOPTS="cluster_size=256k" _make_test_img 32P +$QEMU_IO \ + -c "reopen -o l2-cache-entry-size=512,l2-cache-size=1T" \ + "$TEST_IMG" | _filter_qemu_io + +_make_test_img 64M + echo echo === Test transaction semantics === echo diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out index 6a2ffc71fd..2c080b72f3 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 @@ -27,6 +26,9 @@ Conflicting values for qcow2 options 'overlap-check' ('constant') and 'overlap-c Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all Cache clean interval too big +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=36028797018963968 +L2 cache size too big +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 === Test transaction semantics ===