From patchwork Tue Sep 18 15:29:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10604507 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 BC59515A6 for ; Tue, 18 Sep 2018 15:38:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A77B02B514 for ; Tue, 18 Sep 2018 15:38:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B0FB2B520; Tue, 18 Sep 2018 15:38:43 +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 1CCA42B514 for ; Tue, 18 Sep 2018 15:38:42 +0000 (UTC) Received: from localhost ([::1]:40905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2I5K-0004N6-72 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Sep 2018 11:38:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2HxK-0007BF-GE for qemu-devel@nongnu.org; Tue, 18 Sep 2018 11:30:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2HxI-00045X-NI for qemu-devel@nongnu.org; Tue, 18 Sep 2018 11:30:26 -0400 Received: from mail-sn1nam01on0107.outbound.protection.outlook.com ([104.47.32.107]:28492 helo=NAM01-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 1g2HxI-0003aG-AH; Tue, 18 Sep 2018 11:30: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=PdWl70c4fL9tqklvvPjtdbBiIc79GMOQo4harqsmETM=; b=VHcs0ASu/1nMQ3brcqPk4WPAW8i6NxVhVw9JDlTyqW8fy2jrcdwuXP+582/v7LMDJPyIuMjhS7NnO4gVUKGB8ocqo3gdqO858YLBn/iw0gSMzt3UoXhjIsZciTHs7nVKEaig3qVHqtLmIlDfGPk/yyHkKL8N28cJ2f/C3HuSFiQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CO2PR07MB2614.namprd07.prod.outlook.com (2603:10b6:102:14::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Tue, 18 Sep 2018 15:30:20 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Tue, 18 Sep 2018 18:29:22 +0300 Message-Id: <20180918152923.24824-9-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180918152923.24824-1-lbloch@janustech.com> References: <20180918152923.24824-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: AM5PR0701CA0016.eurprd07.prod.outlook.com (2603:10a6:203:51::26) To CO2PR07MB2614.namprd07.prod.outlook.com (2603:10b6:102:14::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 848173f9-b56c-4b52-ad9b-08d61d7ba61d 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:CO2PR07MB2614; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2614; 3:WVQwq0h/q9XtH4RTsDHAmkQ9cEtoaWr+rgteCb4Yt5aC9O6/Nets/fxlnots9Yp1oKSlANtWsFsC4lHtdQjk5GBtkPjBBhAGF8YMwxyoDqXe4T7JljXlZnOwn9lEwTARADx6LL7GadkTu+n43uAhZaw9pK42OAgf4E7qu3+hG6i06Z5iF6fpELm1rBrZznQrBJd/MJRxVFx/K7BB8pALaNfAZjkhntVgHBokJrikwtLK36brY0uwyS5C7ATttO2m; 25:m6KhdRcgqqA88csLsOKC1oiA1yvBhTgoRnZ3FBWeKVPTN5QVfkixGiIqMNnYWxIl7L919vsSV712BcSQALl3SuLEvqs7BRATLjD1WwhUJmCmrJmtRF8J60WolGEtuCLzOeguGuzRmO40OoBcNg5AyjvwNenJm8N0ubptpvu5JwPDNich0VasBBgcDWRLKIoQ5KxO501XeN07yDUAXuF4WSy0zgOf50rAZ/jh2W752Ir1a6iqT8tkYYUCTjRs2aWldE5v0EBAqcsteKGwNR9S9ngepY2XBy+SAkXBGvgD5a57ylst6DYIW/h5sTINcuzl5FaKBrcikaz/vMLuqEbMgQ==; 31:HLbL4EGO9IsMdR7yS65RLO5nuOiCuFbXkIWbECDiEfG3wK2kpFyCtngRh6Rxy/yo1Ihcxv3h88b1PND/g85pyI3rMAV43+sE/AdtetA1hsvL/QpqrVWrGgAok4a/tJ85tvUVQ33Vc+wfCd6wkzaxO37IqY7F2tnLwn4uqHkpclaBo/WhPidbae9zzyEVYgpy6mO9/5VALxcXJ9KWKKAxOAQRYOiCAE+3IHv17exr0T0= X-MS-TrafficTypeDiagnostic: CO2PR07MB2614: 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)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(2016111802025)(20161123564045)(6043046)(201708071742011)(7699050); SRVR:CO2PR07MB2614; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2614; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2614; 4:3AwDLM6+175dUNLcNCwEzoEbreu30BcEAoIYtQlsROR+Zst9Z9+hwf2sXffvpJXPnDC6aEo83sXxppNx7ar133IBYi7HXx9HxlvxGxhvrvi06ghkz1swcUHfQcjqf4luJjq+qkJF3rCFjbpk6zfr87+7LDZ566uBWg0E+NodIuQ4sNReI0S893lcXYPsjL+iFjfxOptn/ZBtLa2wXsGD9QXfLrle/3w+WbqSblyQBTx7muY+aaF+zLRHz/tZEzRwzuWVDFz9jgIn28k4UXvgCg== X-Forefront-PRVS: 0799B1B2D7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(136003)(39830400003)(366004)(376002)(396003)(346002)(199004)(189003)(386003)(956004)(47776003)(36756003)(66066001)(14444005)(68736007)(53936002)(5660300001)(6916009)(486006)(6486002)(8676002)(305945005)(8936002)(81166006)(81156014)(16586007)(54906003)(16526019)(446003)(476003)(316002)(11346002)(2616005)(186003)(6116002)(6512007)(7736002)(105586002)(52116002)(50466002)(86362001)(575784001)(76176011)(26005)(6506007)(97736004)(106356001)(50226002)(25786009)(48376002)(4326008)(107886003)(2351001)(2361001)(3846002)(508600001)(51416003)(2906002)(1076002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR07MB2614; 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; CO2PR07MB2614; 23:KRb6FuL+PuUOhaz2McWHcFWNEVpJCx6N63riVGa7k?= D0qJgc+n6Hsotuf4xW4fCNZsMjl/Fs6XRJrCtM/t9+eqIXfVO8V05QMYq6E/PReN1diTSM6Ayxuz03+5RA7OH6cShefQm4Th6g9BMQbVuRlkySCP/vCNIvNLbCoSBQ1vZ3F+qz+Erw2547kcQmmdXLPwjgfkVW86o3jLt/7yctoVCosshhtiOn8WBu3XiyHQ54YUa+Oi0XTORdlfHb5p4t94mVbpdnBymYo/lpL8wZoXW7K23+pHAqEH1Z6P2+o6iROFz8kthu1AOmzNAOPIPr74QchHZP/2IvhcVAmu5fKuxjH/XxlGt+0uTe/wMNJ8prMGIheJ1fNdrpZ+KRsf5Ye7ITzSIjY2wUwICAiZCVpEawYsk5dGh2qg1VJyq5SeRoIYuztxrhvi5ygzoprjiJ6m+Pi/VwnvEuESQvoJ6W9JslCTFNTEMbx08w/X5q1T1OwwqDcUDORJrxraf0LmInNJtrOxE2u5K8P7DRpc37jpTrOVeYAVGMTf/Yvj5zUb2WDOSqiLIKbkSYhoILdUMIi64IQ5E1cNSxJfL7ahRkwDXQqZX06jVqR6T7HOBw69RTXu3ai2zmkQnKXJw7nzIYN9/C93ZQUJ+14F1q44k1VRQ6sFNcMl9XFCyPZzMYJeqinXgruhl60ASaN4eewkaGzeEUQYFhuxiiljNoquevqdhyGjEq/dxvh6kiIiOzfGulxmO9CSHaFW/EP1mDhaPWFHldvbTuiBr8RERWbdSgUHS+NJyDa6h7KmJ8g9zvKAocykq2t1vur7Tra0bb+2vT8Uv4EhVbkezSxdirNL7HjXWTmGbW2oFtnFDFuRsLdYUybC+cXalGSong7ueQepAfyl6ycdtUP3MGML9PQgoYsgflUwKjIvTsGf3RE/dw+s8TcwBKx6bnFi4bQvOOjgKqn3bah/8pPmFUNp2yo3wuzNRSeki/uXG56nTRl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gULCiCap9ZJtMzBRFBbD6SBA946+43aQJlE1LymVJtTDWpGj/ojzqGThfnz9cJdLHh2lFcAm6ZSmvfpeUxdiuTJj0XQMyL4FjT5HvgntGHQC71etDsQD6wfqA==; 5:wRqUFEK5BL7wQhkjqnLdnb8hh125hgu1TqMB46SwMn7lbzYEbb/YSPxa40zSAzR+up9nfz6eC9anp29KUFLbQuTaXR8AqbuBYPDyWxefa58IQRbD55GFWRsnwRQtqvqgds9BecpSI/kl87/4jErYx8gHeUPDs7bij0i6jqD5qFc=; 7:5bi2EHYheMjdGSS2eOpNG8rN7SZAvxhd5CbCG1bxz2+voab6WQnUncAv29ntJXjIrY6Z1Zp/WhlXqOGIDW0ROzMAn1uGqpLC2j57OTQeGxNcLRF0ib2dEov6++6A56Vcn7xv67qox3Nh5UgP7oMA6w1MQ4118DuVMoOeAjr+AIL35RhAYkTI17ctTs6SRzwgr8AIP0oRdCQte7R16FAwC9DuCeBeufaRrxDuU3ECWzmfIzbCFtbYSnzc2SBYDCPm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2018 15:30:20.5202 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 848173f9-b56c-4b52-ad9b-08d61d7ba61d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2614 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.107 Subject: [Qemu-devel] [PATCH v9 8/9] qcow2: Set the default cache-clean-interval to 10 minutes 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 default cache-clean-interval is set to 10 minutes, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 2 +- block/qcow2.h | 1 + docs/qcow2-cache.txt | 4 ++-- qapi/block-core.json | 3 ++- qemu-options.hx | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 1445cd5360..f885afa0ed 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -944,7 +944,7 @@ static int qcow2_update_options_prepare(BlockDriverState *bs, /* New interval for cache cleanup timer */ r->cache_clean_interval = qemu_opt_get_number(opts, QCOW2_OPT_CACHE_CLEAN_INTERVAL, - s->cache_clean_interval); + DEFAULT_CACHE_CLEAN_INTERVAL); #ifndef CONFIG_LINUX if (r->cache_clean_interval != 0) { error_setg(errp, QCOW2_OPT_CACHE_CLEAN_INTERVAL diff --git a/block/qcow2.h b/block/qcow2.h index 0f0e3534bf..8c863897b0 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -82,6 +82,7 @@ #define DEFAULT_CLUSTER_SIZE S_64KiB +#define DEFAULT_CACHE_CLEAN_INTERVAL 600 /* seconds */ #define QCOW2_OPT_LAZY_REFCOUNTS "lazy-refcounts" #define QCOW2_OPT_DISCARD_REQUEST "pass-discard-request" diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 5965d3d094..15ae797931 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -209,8 +209,8 @@ This example removes all unused cache entries every 15 minutes: -drive file=hd.qcow2,cache-clean-interval=900 -If unset, the default value for this parameter is 0 and it disables -this feature. +If unset, the default value for this parameter is 600. Setting it to 0 +disables this feature. Note that this functionality currently relies on the MADV_DONTNEED argument for madvise() to actually free the memory. This is a diff --git a/qapi/block-core.json b/qapi/block-core.json index 4c7a37afdc..08c27b9af7 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2827,7 +2827,8 @@ # # @cache-clean-interval: clean unused entries in the L2 and refcount # caches. The interval is in seconds. The default value -# is 0 and it disables this feature (since 2.5) +# is 600, and 0 disables this feature. (since 2.5) +# # @encrypt: Image decryption options. Mandatory for # encrypted images, except when doing a metadata-only # probe of the image. (since 2.10) diff --git a/qemu-options.hx b/qemu-options.hx index d5f4bcadd4..2975fdf9f8 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -757,7 +757,7 @@ it which is not used for the L2 cache) @item cache-clean-interval Clean unused entries in the L2 and refcount caches. The interval is in seconds. -The default value is 0 and it disables this feature. +The default value is 600. Setting it to 0 disables this feature. @item pass-discard-request Whether discard requests to the qcow2 device should be forwarded to the data