From patchwork Mon Aug 13 01:07:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10563823 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 56DD61057 for ; Mon, 13 Aug 2018 01:15:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 459512863C for ; Mon, 13 Aug 2018 01:15:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 398C02897A; Mon, 13 Aug 2018 01:15:02 +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 D43F52863C for ; Mon, 13 Aug 2018 01:15:00 +0000 (UTC) Received: from localhost ([::1]:36992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp1Rj-0004bT-Vj for patchwork-qemu-devel@patchwork.kernel.org; Sun, 12 Aug 2018 21:15:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp1Lj-0007fS-1s for qemu-devel@nongnu.org; Sun, 12 Aug 2018 21:08:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fp1Lg-0001jK-Uc for qemu-devel@nongnu.org; Sun, 12 Aug 2018 21:08:46 -0400 Received: from mail-co1nam05on0729.outbound.protection.outlook.com ([2a01:111:f400:fe50::729]:24113 helo=NAM05-CO1-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 1fp1Lg-0001hW-MB; Sun, 12 Aug 2018 21:08:44 -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=P4aBJaMA2JMHk2ZUOg3jsqblglVTPr7Sig2rngLw3H0=; b=O930F2JgjcLKzRhv81OAkaX4FylWHOl01hqozOrkw5AQ+lYEa0E69rbb6LZIS7J1rttjmbNsnTmi1BoVs/w3I+9JCS7f6meON00UA+nA1M6XBja59Tl5m3yuE/CLHJrzOlE3OXl0WiULVCEf1oH00o4lLWe2DfdknSZoRbsKPyI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by SN2PR07MB2621.namprd07.prod.outlook.com (2603:10b6:804:7::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.19; Mon, 13 Aug 2018 01:08:31 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2018 04:07:26 +0300 Message-Id: <20180813010729.4844-6-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813010729.4844-1-lbloch@janustech.com> References: <20180813010729.4844-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: AM3PR07CA0120.eurprd07.prod.outlook.com (2603:10a6:207:7::30) To SN2PR07MB2621.namprd07.prod.outlook.com (2603:10b6:804:7::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62546449-d2fb-45ad-123d-08d600b949e7 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021125)(8989117)(5600074)(711020)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990107)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:SN2PR07MB2621; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2621; 3:AP4HWX/5zPEM7drFycQ0RyH212s3Fg3/xu87i3ILzL3ZSO7gxy1H1YIfYhtQOdUPRw+MdIDUXJ4FO8yxguOeZAlHThvY5tLZt77S0ZU9rXIw75sdYvGDIrG849ZNqcIAMtSXd5gYXtWyh8zKUmQnyxEmT0+z7oi/93w9cLZrg7vhnjFeTkIRme9gnvvJo65jH/PsA/gd+nKYPvVhpqR0/hizS04KWmgnSm6IeuFZoTRTFHNggP0SbIUcMkbl74Oi; 25:Yg+bixEVjWWhdZvr1gjCN0SYt0Ds6pxQ6iX5Si+OuW71Vk0lioEkIX2dA+rSpBpZG7cfPgj4yRMeL6IPMKwb1t9Yik3JAYHQtdftFOybQp3r1PPNcLwuhK0Bf9Ol2F7kOBs03ECOlAnu6X++NTEqex8xkuI3PrEOFkIuQRcZxq9b+55FHYW010Jv26lerpr6DZP0OdDkjGCL180PUF8QgoPj0A2VnQmm5xGO+CPj67dnZt4GyCLwYWBjb3VHeZO9cSrQ6xVYtWimvtKkmPWhtgmxP+z8bGI7By7rofSj3icZnhRXT684vIWFkSFOduaORkHruOxPEitd5SCVmjSKeA==; 31:/iGH/mUdFlbg1oASZ2m77ZH4AvvW232UFiZT2WLnIfCWIhMXN4evTwb7uSJERb7wyCbUHH8ah9JXMXD5UZtuelTnFtGZIDpQU6yUU76kZ6CP54T5ocPIbv0Lrqxzjkyn7XuA8aLqCzOHN5xAULo86DEep6g6ZXnQ36qP/26sjee4ohkBPsgV2/0eA9GRe7Z/gFFSkG88JHkRQTpS7ofjUS4BAdoH4WSrFpe8rK/K/UM= X-MS-TrafficTypeDiagnostic: SN2PR07MB2621: 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)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(2016111802025)(20161123560045)(6043046)(6072148)(201708071742011)(7699016); SRVR:SN2PR07MB2621; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB2621; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2621; 4:FX//b2MyaZsjP9OTdc9shIpdvhqJaiOb4SHKA1bJQQQ7PMX9UFcKeEeOvRY1CHvJ0yZR8l7TJeIxu9OTYBDa6BHA0bwFhe9BYPpG76yr5gOoA+1wYX5AUalaE+oEvxBuyREWCPJIi1crvAmNGYOXcPS1QZ7AiA0xmpll6YD4c+4yWWtJZH+QGE6zh/p6UoPCQ7SGS19LGyWz4ZJPwcdfz+zGFX5/r9S1PJFr+5LwqK1vKQO/vu2eU+Dm/35onPJy1C7JH0/Npf7Bfs3Ew4bNOQ== X-Forefront-PRVS: 07630F72AD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39830400003)(136003)(346002)(376002)(396003)(366004)(189003)(199004)(478600001)(105586002)(11346002)(446003)(50466002)(48376002)(8936002)(106356001)(7736002)(81166006)(305945005)(2616005)(8676002)(476003)(3846002)(68736007)(956004)(2361001)(2906002)(6116002)(1076002)(50226002)(81156014)(2351001)(36756003)(4326008)(6486002)(97736004)(25786009)(107886003)(47776003)(54906003)(6512007)(66066001)(486006)(6506007)(386003)(316002)(14444005)(52116002)(16586007)(6666003)(26005)(53936002)(16526019)(76176011)(186003)(5660300001)(51416003)(86362001)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:SN2PR07MB2621; H:Jupiter.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR07MB2621; 23:w/FGUn2rlz+2Obm+lg9eaz36kOqSj4AG8qHMMlXHN?= ehrFvj7Eh4RX6OT2+itkyOAqm/8Mpy+1j/YoHa5c5pQEmmCsi0BpuNios0ccuZ1LQsTen8MuwtoCKs4Amg2vkw09Y0ytWaaPmRhXpZW4xSSl7gBRE1BrO6/dSS7bK9Ths0p6gfFuErwbC3LRrgF6WjguobQTMmywYa+PtyUJ2rEwrpU91DxyVpQMrsdHb1vcfnsbt171Pd2e0q5T9+KqQIKhX1pVC6hf75x6HWS2hre+8iZ89CWWZUdFirIkIpVXIitR6UnDcB9jbICeuff353Hq85LZ8eKfEJF+/KXkKpI7eSUGRpBn1TBaYrJySdmQBvU/vuc1m+ZenYs994JnjdnhdOUZn0lziWu0pDerU/mqLtJZgVPq+j2bRqK8EFoEqPvTidhR+xfkB1SCdEYye7l6hZMWuvlTQoHyG/pJQUq6BUhUs79jOwpK9yzuPwP7w3YBgDPIi95xaEcjr4evmElbtH1ysPOcRzuF9dzNj7WjHB9O18reAQazVrJj6gcjREtGISUSIeTKp2Kw+YLnvXOomIg7vylQxrYjQ+cw3+SfB1pw5FgRShqqb+SjwTq1ZAKd+/d3W8lFDTjcwZ+C+ZD3w5hD7QG3UNmg/Ll+3BtGwK2e4Hd7x/T2Aw1VaAfV0eSP7lN9YEF7ZwKRP+83QVtmeByOzkj/82LK0LP/CUJE4RhZafbk9wavNM37WVZvurLkI9Mvc8ppNt2ETyIoK/egDM3XjANBZQzM0U4d/zlEnaVQQPdOqghjqFVZkXajcOOIL8c14kvtfcPVix+d82IzmnR8bnYlHXvr3W/p1qHTARzUBTlUGCHqCFlZGD72H6tf5k4S7iUXCN11oWZFr+XwUsfggF+d+HSd32wQzgb5lv7lVGNR5hT+0VwmyF+GPRAb3TmGvEfj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O/UdLWLrIYbp2bTVP/Gje2VkZQzjjiPj+BSkvTMzotEi58sSHIklaoS4t+awt7pVtRpQfX6HJ6B2VFYAtXiTHzN1RA/IObABlXM6Nn94x4xi9Zo1ga4APOITN9sjaJdM3rwCgroAgSu/PRgvjCReqISL2GfQQ==; 5:CXPmYsgl0DJIesTudmxYYfaGVH79B3c5URGMNC5kq1eC8PgAbhYbFgXhM0NehfXrfgupPtfdqTB3qzu2ygz9ZoAMmAF7rxnX17EuxDSs4DR7WNzf6uuneQHZd0yiQ9m1PUy6pxTpp9NwRcpZsLnW1jLnoHOYxS1D2duklg+BjeU=; 7:l23jBVRhPmE4LrFc0zGDiXMMp1AYGGGByGEvUcGMnWOK/PaKLN5y1y6MxWy3g8FpwVtJ8pQPSSHEiqzPERNyqokQRScyEFduN1GVPMYWJDLA0IWA8ZH0PLFow07DtblEPigF+BKxNrKihEVeI0P7OHn5e5+ZRJvfmasNg94UW6j+VduYRMlpB94WCqLFAE2+/K56Kak7BV3OTEGpu8o8tpY76iWCWOE5VtqIvo9f6NpTEqpOlv3364WS80C0bplm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2018 01:08:31.0990 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62546449-d2fb-45ad-123d-08d600b949e7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2621 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe50::729 Subject: [Qemu-devel] [PATCH v8 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+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 | 4 ++-- qemu-options.hx | 2 +- 3 files changed, 4 insertions(+), 4 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 e89e74b372..0fc438f397 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -124,8 +124,8 @@ 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 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 + - The maximum L2 cache size is 32 MB by default (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 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 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)