From patchwork Wed Aug 8 07:10:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10559569 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 683CC14E5 for ; Wed, 8 Aug 2018 07:12:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5226E28741 for ; Wed, 8 Aug 2018 07:12:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 443CE28941; Wed, 8 Aug 2018 07:12:48 +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 C3D3F28741 for ; Wed, 8 Aug 2018 07:12:47 +0000 (UTC) Received: from localhost ([::1]:42131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnIeC-0004xl-N3 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Aug 2018 03:12:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnIcy-0003yZ-9i for qemu-devel@nongnu.org; Wed, 08 Aug 2018 03:11:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnIcv-00035E-1z for qemu-devel@nongnu.org; Wed, 08 Aug 2018 03:11:28 -0400 Received: from mail-bn3nam01on0127.outbound.protection.outlook.com ([104.47.33.127]:38720 helo=NAM01-BN3-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 1fnIcu-000343-Qd; Wed, 08 Aug 2018 03:11:24 -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=lpcM/uU1JZSMe2csVA8lC50ZPsGI9vsAXtk8x91pPTM=; b=QarzSB22t8WObvlOIZ1KcKL2/Jiz4grOOups0CO0iJC5enxW0FxHJvLHYLL5gUXRUVjTKavrV72wYaAN0JKO3xZ5qZX/yQslilM0Gk1XD4LmZ0N7AkgrMMLqoih4drGvYzoz3aAFQNtB7fu0CCcXW8F3B0/NA3tucKxL3ekP8wY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CY1PR07MB2617.namprd07.prod.outlook.com (2a01:111:e400:c637::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 07:11:19 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Wed, 8 Aug 2018 10:10:46 +0300 Message-Id: <20180808071051.30628-1-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: AM5PR0102CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:206::16) To CY1PR07MB2617.namprd07.prod.outlook.com (2a01:111:e400:c637::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97a8daea-49af-4bc5-d460-08d5fcfe24a8 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:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 3:v5sgD0ZX+6+hPiMsiszYfukFuOGiZRBF3ooMeuq342/Ek9Jkn63IbeLbM7nsGlKzMmKwWGs1kQuLvBjbtb/SVQnMWjBRGDNDqlUKLziH6j7WI2/SVTcN4U4fqiZpFC2AZYrgj9tQbckK/Vcsti9UfQdewGw9O8Sm/koo6i6PLulqgQenvwZ14p3VxRIv3Sceb5eQt6jo8kanpNY5MLcVm5pepg3uPDNIVwKTwzB+5bEHylTwA3E/HNfrfWDCWQeG; 25:KyfgWOxhCr+Cv2c8hdvncX9ZqRkErXtsH/Gx2kdn8WopK+OkUQdgYG0Ta07kh6pEHXChWjPgO/O1H/VouF5OITJXNDBYEqZCg0VyK9ByHmyIpWxa6ahp4nmt6JqVIT3GGLCAF+DQwOv49otkfK66lZVMG7XTSzywRkzY+LRZWng/d9Dvm2802ROdv8I++2/o31FSU0RT7lO0kN2kA7V2dDoH+f+formp5Uee0y2/w/HXu3vIYcD+4YHF15PmQaUn/+mwgjU5yLXKf+gXYF0vPWRdywBcAZDE0g4ZyK1uAG49yiqXVSIS8PLjzD4Tm7tE+Hb3pwdVt+rfF9LGBJtjhA==; 31:UNK694Oij0xsor6L10YTpzvX2k936Kc77O+I0c6jt7dDxonkOZS1zJbr7hfWAY2RBn3odLWHevGqC0amblkevdMDrwjw83GZhAH04xAAKY9wegTUlQM2cZrSmKU8UgSubMnGRy4eS4zQ724V5Ej2ofldBOSYRFJUT++yV34VyWOJ5zFg9fKJf4RsBWu2zQZQxG9e3Dm/8mXxelrsGEpeVuO5oX/7EBTBr277+oAYdyI= X-MS-TrafficTypeDiagnostic: CY1PR07MB2617: 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)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123558120)(2016111802025)(20161123560045)(20161123564045)(20161123562045)(6072148)(6043046)(201708071742011)(7699016); SRVR:CY1PR07MB2617; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 4:qSuxpkICnaipmLgEKxl2tOnwXY9OQnT0LRQyWE8LFxyDzY+hBpvOuclsHQNjHhCGwQBxW1V1v+p1rbjIifRcIfUY85lmOnwkwWUG+1IpVQAsGfPFT+JRny8cjaTQVni7VAoDf7DkJKQJqxkJB453omUMmlm4r0j98rhzx9Hm9+jOXrzdbAMz1aSfqOES4O67ISeu0dZHjOfYpygUvP0kqGTVYPhLL5WIfpU7Hpj5dhyFX9M4TTNjwc6to2kcXW4Z+SsXv/Xy+Md0gZDgEZa5UQ== X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(136003)(366004)(39830400003)(396003)(346002)(376002)(199004)(189003)(36756003)(6916009)(107886003)(6512007)(4326008)(186003)(53936002)(50226002)(25786009)(51416003)(81156014)(48376002)(6486002)(8936002)(50466002)(8676002)(68736007)(81166006)(52116002)(6666003)(2906002)(54906003)(97736004)(16526019)(105586002)(16586007)(86362001)(66066001)(305945005)(2361001)(2616005)(316002)(386003)(6506007)(2351001)(47776003)(106356001)(7736002)(1076002)(478600001)(26005)(956004)(486006)(476003)(6116002)(5660300001)(3846002)(14444005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2617; 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-Ex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p52eu5eRd0ZFTdytCj8Hw==; 5:uuMiG9ceOD/KKRw6nIAKIJHALaqFtmJeWTuLRf1pYtGfRmla2U8KoQeEzjfsFZQkRcGHAWDrvbeF7tkJZkP/QIZmPcCz5SyCXgjDYVeWSGKsjsf9P+qRpjvwxcAdFcde6QrR5X3hlreP5XwPFEaSJITmCxQuMMZNSziUrrsSu4s=; 7:dMTjdSAK3Sb0N7myPIoOFNEu/lrcU5D99oNtEgmDDPYxoXrvNPcmsBjhOfhLsUVptIF/uXYu6TOW+4RVwQ+c4Ex8GFM+1Vh/iVx5ologJ6v661r7+MghlCxmvxWrJ5gJIL58ko4cs2fR1WJE3DLwHihFYl0xWDXiivciOm8nMwL0pnIzFM8CD5CPWDVFbNDIJ48R5s2ja3hhTMcRr2wgUVEOUsa4lVYoaOT4LYmpJmGs3ZUHMgRphH58AxfQq7km SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 07:11:19.1615 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97a8daea-49af-4bc5-d460-08d5fcfe24a8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2617 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.127 Subject: [Qemu-devel] [PATCH v3 0/5] qcow2: Make the L2 cache cover the whole image by default 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 This series makes the qcow2 L2 cache cover the entire image by default. The importance of this change is in noticeable performance improvement, especially with heavy random I/O. The memory overhead is not big in most cases, as only 1 MB of cache for every 8 GB of image size is used. For cases with very large images and/or small cluster sizes, or systems with limited RAM resources, there is an upper limit on the default L2 cache: 32 MB. To modify this limit one can use the already existing 'l2-cache-size' and 'cache-size' options. Moreover, this fixes the behavior of 'l2-cache-size', as it was documented as the *maximum* L2 cache size, but in practice behaved as the absolute size. To compensate the memory overhead which may be increased following this behavior, the default cache-clean-interval is set to 30 seconds by default (was disabled by default before). The L2 cache is also resized accordingly, by default, if the image is resized. Additionally, few minor changes are made (refactoring and documentation fixes). Differences from v1: * .gitignore modification patch removed (unneeded). * The grammar fix in conflicting cache sizing patch removed (merged). * The update total_sectors when resizing patch squashed with the resizing patch. * L2 cache is now capped at 32 MB. * The default cache-clean-interval is set to 30 seconds. Differences from v2: * Made it clear in the documentation that setting cache-clean-interval to 0 disables this feature. Leonid Bloch (5): qcow2: Options' documentation fixes qcow2: Make the default L2 cache sufficient to cover the entire image qcow2: Resize the cache upon image resizing qcow2: Set the default cache-clean-interval to 30 seconds qcow2: Explicit number replaced by a constant block/qcow2.c | 47 +++++++++++++++++++------------------- block/qcow2.h | 5 ++-- docs/qcow2-cache.txt | 31 +++++++++++++++---------- qapi/block-core.json | 3 ++- qemu-options.hx | 11 +++++---- tests/qemu-iotests/137 | 1 - tests/qemu-iotests/137.out | 1 - 7 files changed, 54 insertions(+), 45 deletions(-)