From patchwork Mon Aug 13 01:07:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10563821 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 9F161157B for ; Mon, 13 Aug 2018 01:15:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 887F82897A for ; Mon, 13 Aug 2018 01:15:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67F74290EE; Mon, 13 Aug 2018 01:15:01 +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 D7ECA287AA for ; Mon, 13 Aug 2018 01:15:00 +0000 (UTC) Received: from localhost ([::1]:36991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp1Rj-0004bA-Qg for patchwork-qemu-devel@patchwork.kernel.org; Sun, 12 Aug 2018 21:14:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp1Lj-0007fW-H7 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 1fp1Lh-0001jn-Tw for qemu-devel@nongnu.org; Sun, 12 Aug 2018 21:08:47 -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 1fp1Lh-0001hW-LB; Sun, 12 Aug 2018 21:08:45 -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=L1s9YUWAOprndIMpl+4JMdbnYtR9IQpHsDK8D10tCpI=; b=hdHldI1C02Gys1Kn2R4KZso44avoLTCFewbC/WnrXTy2k4F84SX6RWVijXU3ZPkcN/thIzWbM20kqwnwzI+ZGlzFVJ4LqCtSw2nrX/igVj1zW1TLRqyHsAcYIysqoF8zuIRLEpSIPBQ7ODdmx2SyMtstCfiN4I/j/1kgH8t5PWM= 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:35 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2018 04:07:28 +0300 Message-Id: <20180813010729.4844-8-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: ff8cafda-5ca3-4c07-cbdd-08d600b94c89 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:wIuqQVkoJ6bmFJfpbO5I620xCO/2zGnneA3j79iccS47u0lMadgw9K7KSmB5qkp48jT66Et+W92su9y5GFAUDafNk70FVrSsYt7qmgbt5k3kH4K9n8PoUxMCGXb3+zLJFNJG+2vt+KR1fsGUi+RJHo+Us3Dpia+0lyIwJVnWEjkoozTkSZM+4fPMXil3yW57IWebUg9AZWhhZ2COv2p9ozoXoa/kBHBdmzLl+8w88xeSTA765kFRWhrPuv/23tj8; 25:JoHrD9s2A4I1l4LTwT3T7znYMKAxQFO3gx4Dh2YnC/oUv5ZDeS3+iuvhhKwCo7O1nobDeBo3sznmFE9dYMNEbeIfvgyYWxL7c3Ku27GC6Hc0Qth0vnK22nRdJW/Ia4Io8EhWv1xxP5MxJ6RH77ZZmYCnsuRs70yAgH9kaUx9JIgA1/b88CJA96FLodYG51qnLpVEI9L4ONog6bZfRhdd9hPuXrp82ZpHhOndB3EBpcYy3gmw0a5EmgUegfqL2uCsIHuIyclwY2zoyvDJWo7mP1AglQRPfA9H3AWWytZ5gc4RnsXljbRic0Uo4S8kxJTa9Dx2zxupV6FW0Y0++4Xb6g==; 31:Cn0eP6cSPeOHT4FqHrpTHyrfMbmunrK1PL5P/hQ9iGKLz/+Ke7nTgmW7PlvUrIAuEcLpKdYgSCL2Wu0AKWEGGwnyxVtZx//nx1G/vVEyKLCocTHBV7UEFc9RA10mZP3Psv2Jzi3ROBzJM+StgYweiUqIcHSspA2wN8ahwtB6nYq7ReQsvDMEYG02l5Za/Gntz8gJR8JdssDUMBYrUySlv4B2TRKk+/b65VO2B4Eyhbo= 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:JbW4AKHy+9cHUT0OT8t+rUnaHkhJxxQ1i+0hPpwzVG9COIdwAMSF9YKH/zGL9YmVNfhul3FpcKFUp+nKNHw3rk0PL/UqHzOJKTnyVsggDywpx7Sq0jS68Izel/acKkCkmT/Cv+Dg84RiYf6zKD4f6KAElI1a9WZXSqjpCIcQsZD6p8PK+VXgh1p81wz+eA7rnA5rbnOL4JnCSJg0Mn1WZtYadBS1gj/TwFGnbFv29dENjHrWuThUDW2CuoKwlaRebtjvIawe8eVlZA6eP7sCvw== 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)(575784001)(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:DdjdB9vzMcbOVz5KT1sI/teb0z6efmenmpyj2rcTu?= 6b4WHmOuqTjT7h7usKN4j3bUZTCZtlNB0gCCfEeYJxAT8w8dy3X/UPPZ9sIA3fGgZrnSByUSpADCy8pyiFIHRXr4l8O0Aa6PHNCyhgOWSq73sO9OigOH902KwJeAt+CiCgFw7j+ip7SkF8ALoRthkGGC2WxG/T91FQCAi34FWV3rlNfH3J7Th3N5IKH5wCWL6cPZTISZauKb0NVgWlnuuPZzJhy2N1X3af+cU5d6eqD2kYi29nKMGNgiaHYDm/0Fyc0MEzpHhDmG8W79nNa6zxT/ZuCUR59zYSf1PWtpIWdSRAadmQR/Rj8MLMEwTVNklklEWXjUFXmuEveiYsxur06m+8o77XRt5zcvNuCb9oO1JpisKvLrGvlPMa+IpRgriRHIeMcOpbPfobWuHLVL1ozlsgbdweQoD81GAJITAn9Hbi9th4K5GDbYfwdqm/sBDyg0XQu2OEkko6JtoUJZatTRETayP1Kp0N3GxIii0O4480UksXBhmivUFJTFJhdGUEPDpIZhXS8J/RUcOH75LuULXriONQC57hZ6Ubw7PTEs5m4CEjT6OiXfdUQXNJ6wWXqWBpBl5tdtynuKIkVw4OhCiaLfrO8pwi4AjtOhrIOzmiTTGLQxjkwtu8fflJA9Aa1GBewQf1vTY9pWvO0ykwnLdlwez9n8OLslNqAwmAD927yOHT4Bc5RBbEzjiL+1O9HJtOGYS3r4+ekClKSeyyY7L117/SKNw9UHQewutvubyja6UWfVy2pXNK1DZbGXjCx7ZnCFUiPoTY/yMtOL+J5L/qjxaykIo/3VVz2vRTwTpgkd+4Te9Cs4WELo6YMCLQdQYbZp+7MX7LP/AEEX8VnhreNMjTveP1ls+C8PhEC0VVMbyDd2esI+j8Xd5vYvhS628rk5Q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+lA7y6NM18nQzFb9xeFatASWvqp1Brw2AWPXqj8V9ztekW95XK+Ri2CzdF/n8f/G/yYgcHGE7VKtqIn3KnRMZ7TOaShmMPcQyG3mlKhh/8wnEwr+sJS7NLXtnme/ygdJp52Dt6KaY6Sja8IEik8BZ1LY5Q4lQAPA4wpzKHzfw7FlX3t3lIRPKR3h5/QyD3ISAborL+A7f12XMoA==; 5:ZQqWMyUvpRE79i+6VslXgZg7Tg900AlqNIT1J6d7INT/tpWKoajGPM3vJWblv7w5o9aOTS7Cg4pFWa1EfcZ5Uzr8KBiPSS1QhJL5yxRalPbq16ISjMnwtVKDun4vNOuEwRJVCYpw0K0rIhpTRpemsC0YXDLTWCSR1m7dLGgrtn8=; 7:l23JLmJ59pW2RWJNwboR1G7MVJXF/kYVz6CrtUJrYO07HNTQnPcOd3dlK73PUXQdGr51xturTgsqJbIe7rU+NgN+Wqbm1DC6Y92T6kLXgKzfmgtixvkaUBveA12ZpdBDcB6LLp7yTUi5i3DM848IPmzp5bv5uL0zz2Rk6oeI8tWKb0NnuHGnxeuQ8tSsBSDrvD1BTjSEPt65XvuqVwMRKR4ZcGJtXG6dcDdNUBpuKhj9CzG5oNoed39FisGaoE8b SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2018 01:08:35.5365 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff8cafda-5ca3-4c07-cbdd-08d600b94c89 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 7/8] 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 e699a55d02..5e94f7ffc4 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -78,6 +78,7 @@ #define DEFAULT_CLUSTER_SIZE (64 * KiB) +#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 0fc438f397..0530d79f5b 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -206,8 +206,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 5b9084a394..9a6a708a37 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2830,7 +2830,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 4c44cdbc23..6abf3631ec 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -767,7 +767,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