From patchwork Fri Aug 10 06:26: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: 10562269 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 757E7174A for ; Fri, 10 Aug 2018 06:31:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65D272B41F for ; Fri, 10 Aug 2018 06:31:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5944A2B438; Fri, 10 Aug 2018 06:31:26 +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 D0A962B41F for ; Fri, 10 Aug 2018 06:31:24 +0000 (UTC) Received: from localhost ([::1]:54564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo0xI-0001d6-0j for patchwork-qemu-devel@patchwork.kernel.org; Fri, 10 Aug 2018 02:31:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo0tj-00070q-Hb for qemu-devel@nongnu.org; Fri, 10 Aug 2018 02:27:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo0tg-0001oP-Tp for qemu-devel@nongnu.org; Fri, 10 Aug 2018 02:27:43 -0400 Received: from mail-by2nam01on0115.outbound.protection.outlook.com ([104.47.34.115]:38988 helo=NAM01-BY2-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 1fo0tg-0001nM-Ja; Fri, 10 Aug 2018 02:27:40 -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=QfkMY/X+kMMa3EVzj2Zu+EoylnU1ox5aw025w6NZqto=; b=nlHybpGu+hbbmf6flmcnAVfGd+QypGmV8HBP1TgugPOtyxng+oKZhY3x+ILi3VudlhKOvYen/MHiQrhDUSdMINPlvyc0ppcfGuIRp2Vo7EEW8oFXUuwrsP4g5FC56GiQpM6hS1gmvrauRdItel8xR+mCvPcN4WeZK6kMsxTGNvE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by SN2PR07MB2623.namprd07.prod.outlook.com (2603:10b6:804:8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.21; Fri, 10 Aug 2018 06:27:35 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Fri, 10 Aug 2018 09:26:46 +0300 Message-Id: <20180810062647.23211-9-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180810062647.23211-1-lbloch@janustech.com> References: <20180810062647.23211-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: HE1PR05CA0232.eurprd05.prod.outlook.com (2603:10a6:3:fa::32) To SN2PR07MB2623.namprd07.prod.outlook.com (2603:10b6:804:8::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e625aa39-9e6d-4fa3-c6b7-08d5fe8a5e14 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:SN2PR07MB2623; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2623; 3:J1Ki4XdBFNZs3kH+9JsABLDcn2RtQkLnh49sSXCmeqHIMTE/XIfStziqM6fQ4S4jnGTB6xHxGLCmG5nKZdItILzRKNdkMgYfa9M3NeyrtI7RQrqrezf0B/a5PTZF9TNDA4dSGVug0hayY2WgIBxZAOLUadwHGjyhhYzeCfXQqRrcYpf0tLwXRCkkW04uyEWL7I82iqHUBnmqtLDlHGYcdqRvYCI5tj8uNWGOW6GTkoQLzYbhK/cHeplGSz2RHj0X; 25:NvP4YMPc5bUF/I95I/JI5QL7MtHjziBXBlZJ1ERRuhkO0MOHe34qJ7KB1EmOUP/3AyRjgbm6W8rvf/U8hPV7EAKATutlCZjO7gH7Z3LHPrwUw6PeoPZxR51zALtPx3t7IQM9uTqgpsCpuX8n1OfHT+6cE+kNIuC6jmO7Ec2gcW41u8M8BJovAVoq1cyhe7iVnK3De1/DlPoMCWRpoVjhhBeZ8ehvC62H6bQQLV12DCaYeCAHNUjN0TkMH/BUnIpp6JkrWepPRfnAWNyIx0iQqzvrH4yAG2+1Whu71gaQH/EytdtPNyLTMRG2vdjS1d3RN53IrcjOWEGtF3ddHS4ovA==; 31:V3+eM+F7taMwZVcHYUZA35VZ5uSKUErI2zf/s2J9AtXCmGXPXSDEYNzCv5U/7HMYK3kLqrCAyHoHdTOCiIkopSONaq4NCPnHhpS+EYm7BpOa8G7PWUdYDxyr+2xnKq1s4OtdSlTD9+pr9CX+2SEm/BpV6VFzx8Ay0+U704uqJyF1Qb/MlU3bufVx4g0TzvbzTy1GKz+sYo1s9rFI2kK+Tv6oE1yfujpblT9sItiOn8g= X-MS-TrafficTypeDiagnostic: SN2PR07MB2623: 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)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(2016111802025)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6043046)(6072148)(201708071742011)(7699016); SRVR:SN2PR07MB2623; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB2623; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2623; 4:vivnlZ1K/H4L/VcmRsCKo2brv+l+NJf5cGAlsZiaKFskXYf6RXX3qMn7oJwEjNITeMakEieTl3/4Q61W4SyNBUvOLQL218Y0Fv4ktjfbJ1/MpreW0LKLWidu0YS4EGnB2VjIzx4oPkR7rY5a9itujYTph/2iTkdhmgikCukUsG4wjSu5TD6g+VlrEMOTAntiFsLF2y1ohLVE302ylTwCQ+lAnYiORQw3m9XUHBh89UPwzHbZzkor0bL+ZdWIGv9zCeYrV4aY6aGBtJXWjHXdng== X-Forefront-PRVS: 07607ED19A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39840400004)(366004)(396003)(346002)(136003)(376002)(199004)(189003)(36756003)(2361001)(68736007)(47776003)(107886003)(105586002)(4326008)(5660300001)(186003)(106356001)(16586007)(2351001)(6506007)(316002)(26005)(76176011)(16526019)(86362001)(6916009)(54906003)(6666003)(386003)(25786009)(478600001)(11346002)(6116002)(8676002)(3846002)(81166006)(50466002)(2906002)(81156014)(2616005)(53936002)(51416003)(446003)(48376002)(6486002)(66066001)(486006)(7736002)(476003)(305945005)(52116002)(50226002)(97736004)(14444005)(1076002)(956004)(8936002)(6512007); DIR:OUT; SFP:1102; SCL:1; SRVR:SN2PR07MB2623; 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; SN2PR07MB2623; 23:SquuHP0k4oZBYd9+a+psIBVbwF5MMfH/xzoilp+c5?= LoQlrzwZUcWRWVWOEGEPhuN8X3pVX57Oz6/T6ElaCkNaLfLm8/1dOx6PNnQ5Myz0hSt8qLJsagqOmszP+4jFXZ++YScLIWAbeR/wyC88vMoXeEYrhdyREA/eUE9dvEc5kFAWtWTznVP8x1Zco26+AnAg7srK6DpCMPViLyKB7n/z60nzCEoVGgdrl8JGMIID1iUfjLBfJ7GKweo6ianZHF5O51blZQMkQg+vltyu4csrUzhCl1pKQ5TloXctoHo9bQvqCXleDViSqfoqRWiLsLgK0d90PF7SWsSEjZkIT4i+zKStWwlsC63gcsXQURIly1Bv4n9Tvj5NOKYhBnbud9Rx28y/l9IbWTJHIRjH2NOiSB6hHsHiIXWKY21/GM7KgQMvX6Ajsv6QZNgUcUxzz1hT1t/fboOuLh1F+LroSvTLxhybVAWOAXZebwOcta4CUL86YNsRbPaNLO9RoJbATV66wxSMV4YsicnH5vljmLTqbWZL+MEquntK6XD2b9ZX7GMZKisrGvOyLuwOzbJXqLvSd8qV2c21kjvIN24BIuLcjshpDPTYCWqTWF5OnkJ5UlCcolT5QAy0/rClMtThP+wAHBwu9cKmEmEjDf+Q+IMb5AR29i5cpzFdM+aTD67mUALtBp4Xz8/Zhh3Cwf6GshixECIdqNUl+TfPiLSmbikrd8UnpSTFgdBotb7KyYRmmwz+d6uW50/WASZ9GX7QVdC39JX/1l5YBjZ/VAhK1SIt5AbD0B/GqDgOvqI0wFElc3eaj2SoLoqqn+O4Lyt5y0RYncDH93dH77u3D51CcPT1CtdcSEIBQ7OuMVXAlTTI+ugtXf7V1PyqBj8j4PsoYFxptpiJ40NdLRMycL6l18L4j4OyL6XfEDWAF10sNx6PhxGz2agGlX/OPhjx47v29+yS6TMUSIZ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p9Gn3TO08WICHbz3BBFgLkbRT6UudN3HQq0g+xeVLxpy84/cr8/xMEguzFNI4K7sIWTb7o3STj8uZldylUD7bXSkLJI9BWeSqyq9ClXABEBkKU9tO9BEu/ZbqM/vctDw2VSPkOK5z5HFAD2tAB89RItS/bOO0pQ==; 5:XWegKLcJL4HYKh4mTALa6UmkzJnTbZD8xMA+pId+Ov+JBOpwmWWQ2TbJDxmOI/JqZo8DPaJfCVi0+xr1iAD0lqivtOsAwPlbEAvww/1xHOTS5GIFDm661BN4CrzlCp3l/8Pbpt0Eon1WpMg1olLn64FT4UBEm0VXsTL37j83FMs=; 7:vPtw2c7tSXX2I7LqsumnJhFC9j529Ogp6Oj7HvNzMFL1++sS9S8SXThXcDWP0v6m1qlOqYG//3XShDxOb/FWQ7PnaXFrOIqxsXxAWxHo2+e5fPVcNSXoO8A33+//bYw5sumENry3iwPUu0nf6kciHTUcZ52DG8vcVkusgkPa0x2LjAOMWPr7+tHC+G0CFcrzAc5SXZPmC5plqEZ4V0q/52NXgNBvgLWxSLTHlSipCLpQmO6EXUKEZ3o2MS6R1xuR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2018 06:27:35.7186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e625aa39-9e6d-4fa3-c6b7-08d5fe8a5e14 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2623 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.115 Subject: [Qemu-devel] [PATCH v7 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 ba4dfae735..b4f291765b 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 6ad1081d1a..684147ad45 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -204,8 +204,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