From patchwork Mon Sep 24 22:53:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10613019 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 9DC096CB for ; Mon, 24 Sep 2018 23:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F7A72A083 for ; Mon, 24 Sep 2018 23:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F5C72A086; Mon, 24 Sep 2018 23:11:17 +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 003AF2A083 for ; Mon, 24 Sep 2018 23:11:16 +0000 (UTC) Received: from localhost ([::1]:49177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4a0a-0005tO-7B for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Sep 2018 19:11:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4ZwH-0002Wq-T4 for qemu-devel@nongnu.org; Mon, 24 Sep 2018 19:06:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4Zl2-0003YQ-0z for qemu-devel@nongnu.org; Mon, 24 Sep 2018 18:55:15 -0400 Received: from mail-co1nam05on071f.outbound.protection.outlook.com ([2a01:111:f400:fe50::71f]:6784 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 1g4Zl1-0003Xg-Nv; Mon, 24 Sep 2018 18:55:11 -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=MysSDJ8Z3CrFvUK+5DQclx26/syKqJx+ng5/MX7XLYs=; b=XohTprU4oALT9ifnykq2CXFZUUi3V0BqhNu6bwwB1VaEDtQtphhWupHaGY3suzUd6rWdy0fKhETbJPm9RPKssmZiCPnlmMTHb3sivU9maVRvpNG78A7zVBiLeCmJq5giDXMcI1Vt/ggOUNKP+uLQCFBgzj2lkEMeVNJjfFUQgSo= 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.1164.25; Mon, 24 Sep 2018 22:54:49 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Tue, 25 Sep 2018 01:53:56 +0300 Message-Id: <20180924225357.24245-9-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924225357.24245-1-lbloch@janustech.com> References: <20180924225357.24245-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: LO2P265CA0063.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::27) To CY1PR07MB2617.namprd07.prod.outlook.com (2a01:111:e400:c637::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e49ebffa-28c1-402f-43bc-08d62270bc32 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:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 3:WYLBBz8Xq0nTGXqG4ctxN3hMVgZohgx792d6sQ62avc2MQB5d9ui75P4u0oJy5jnSGdViUfmIdr0Hzu8pOUajOsoLobSBu3Fb4/Q5Il3rezugn68r9bAeka0y6JiBBAXiV+eFeMiwV++vSMpeILsRvieCUvmxKhfhkc182COuOE6UysAlW9kcM9MH/sJZB5m+7YyGuooujyK6yy5tCxSUnVHm0P82HdkAAGUb17UGwqK/zPq8vjRGnDeC7ASl7dU; 25:7vt8fsJqt15P8RwELgXPFJH9qmyg24CoTKX4AQG3EmvCZB2kuYb1zuJ1sUnNFeWZO4CMtd18+pPSjreqx+qwi6dzg07sQfEsaBhExvLw+Fs+9eKDhEvl+O9GzLfjfWeskbYs/kxU6feos048efl2a3pxIUxPlRrbB4HQPXpoCwS2i0Uxd6sfXTVwJmlZnxDIa6mX8EDvBbTtWEFR07DR9P8nvnsMCWyygeTQyxrJwCYXfNyAoy9vhn9XAWwvrD9jAJ3XRjUwo0DPCy+vHicUxqcdzadbwh8vbcs5U+EMNHeYiy1NxtZIhUrZgzQ9wXA1AK/9guuKliS9BiGZc714Gw==; 31:E1mVKpZLxa1XV83UgkVJH1jPzS3DXbdlI/8zLcZU1LLaOxRJidxLb+DVy34yy1BA+GLJ+Lk6Sn1DJnHEy5G48W1KhzspyyLBabQDrxK8gu9H/2nCmflLjLVHY+CWYbQFN+i2C8dSrTrpIVAf9y421WMIWmXaWEIAzcyzH0BSvVAjJQnFneKJbfaJdvUenH+12pT3E24o+mle5inGIGT7d1GvzXCGvi31r+D+y2vmVws= 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)(10201501046)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(149066)(150027)(6041310)(2016111802025)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6043046)(201708071742011)(7699051); SRVR:CY1PR07MB2617; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 4:uvfZw/hvlWUt1MU8ytGnKey+xKykYZVZU/jTazo6TlU2ue4HgezIH6MVr3+HyRuXik0uA1S47RynXADReUZxpXguqXQHrpzivwz8jat/oMnM56aahkN9HAF3PCOXPQGeZjnfjnvaXlciAap/LPZ8ZvzDuXxGxK+0w5mU8Eqsipn0NE20k0kv/CNBTdj9Hkt0oEMwlUsYQkcyyoMF8XcHL2spz8G/LdcGcUR2UKLS/zq4DoRP8YNIykBCmlbTVNbmRSHEjzVb4qKqdSsCtEOYYg== X-Forefront-PRVS: 0805EC9467 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(346002)(136003)(39830400003)(376002)(366004)(189003)(199004)(476003)(54906003)(68736007)(14444005)(956004)(2616005)(16586007)(105586002)(86362001)(66066001)(575784001)(6666003)(7736002)(486006)(47776003)(106356001)(51416003)(11346002)(76176011)(36756003)(446003)(6506007)(2361001)(316002)(52116002)(386003)(97736004)(186003)(5660300001)(8936002)(16526019)(1076002)(2351001)(81166006)(8676002)(81156014)(26005)(50226002)(6512007)(4326008)(6916009)(53936002)(3846002)(25786009)(107886003)(6486002)(6116002)(50466002)(305945005)(2906002)(508600001)(48376002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2617; 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; CY1PR07MB2617; 23:VWMJJ/pjHIWkEL5uuJU1t/QNfCOY6B2/+6jpZQ+tr?= ALT99mAFxgS0c93tR3pMOB7nJcG3C8FyOnEiOllwUi6OqDG20wf+bFbNZXJyRj6bPnTSSXcMr6ukUNhoTa5xvBGuIAigD7SVnDPKFr+Kdc8ofHZv3CCeDyQicB2qulOcyENkgx44LMPOrM3U713eqinwgPqZuVhx3T0UjuWMITpOvINGbxOhW7fDai9MvDQqJ1UY9qhUAC+z3S4a3BLbv7mtNUN6L0dtjYi9tB4VZDYkdp1AjF99yLWjXMPlNdwpprPxcR678psyeOhzrd6Ncu1y1q9bZ/qIZWUTbJRMnspEkfiPtZqH7l8/82aVuSZpBjfHn6pyRbKIgPXC2CSMJcMEf1BUMrsxod89clMclcLTmKaZexW4NGNZxDO81EDiYi5c3akeImL/Z5I24qfGC7sEgMU19mg+Exoz+sS7JDEUhJKVhLQJbk7RfluvnKwApUH7gBxM4xdcUSLGHlPK8QlCOT+hy2PwWrpnqCquw961OnOf+V5DwM/f4GU6TFUZHG+7XyL29+aBgddLi9e0HrbdijlomJRQ/r/MhH7V6AdKvERCI5GN5VntUEPXcKjArkGhdTmRLeJOhSmBptxClBKxPgzo287ln4qaHcS8KlExHfnCBNqm2RJOpZvyhEZ7YBdNrZLifuVR9sFhR8UlpdMFV3+RDMdykwKeTcbRSxzaf6GdL6Fil1Uv+rR5sts5be36RUjjv/YCztRaE/2jxPEIk8kbXKE1/IoBDbKSM37ivD9igZ1XPhawfonVuOB+G8JzMz+SDku4aqChOMGGjiENeUBXTOqcdyZQZC4PmIQddu2vO4sDU/MGQjaPto1ernENSDe1mflb74rd2VTiIAvGl9p8xSvg4HRC25YPQ/bOMSQtSPyQGeZU3aK43wB/yC7hZrokeoozEWVxfG8Or+E4Mf+5wsJWBVcxY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yzBNlCj9nSOORu9FnuxuuTpRKyDeGHPalHQzMv7QjdP0/RgMeZlXCLyw4iJxC5m31IaKEjDqF+y9KAaQglyvX8cSEsbU3htgN50vXVTaKAdu9Z4CbgwcPCQk/l6I/z4b/+ypLLjAypQ98LKGj7L8ohAOxrZpDoxPlPw==; 5:x60pHQ7dAZ9eZe4LAPUkdnNpo6IskYdOHU0j2kwSerpktxNbTSocdttuvBk3qlsPUkj5l5lZnsm5Qej2bF4da1EzZjAXYvulLk2hukuw1cAqPqh4D7meiEnCpWgTi7Oz2vAtfc2TuxC4scXRPS68yOG8WGGuYdXhZpXKJJm/P10=; 7:++x4fob7BgDdoKl73AdnBoDbWVtsWMSzSC+74DsTKsaiw5A9jJZAnnpoLhmvnOJTZiVxEbBnQ64uz0eLUNQtZLYDJwLplCrchKqaHn8EmB1i42cj377p6v1/Wj26KMTWb4MY3d9Dv0rEKOyWh5nKJdgbskdJzo61MKJx1WPsERZB/+iXJ6m3GuNyylOifrXADig+u3cYnvtM0772kCIWGqFCQoxMahfr3p6Mq/JKavskCl08s5VdzFFIR3AOG+UX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2018 22:54:49.1096 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e49ebffa-28c1-402f-43bc-08d62270bc32 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: 2a01:111:f400:fe50::71f Subject: [Qemu-devel] [PATCH v11 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). * For non-Linux platforms the default is kept at 0, because cache-clean-interval is not supported there yet. Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 2 +- block/qcow2.h | 4 +++- docs/qcow2-cache.txt | 4 ++-- qapi/block-core.json | 3 ++- qemu-options.hx | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index c68f896c66..3c1859f9cc 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..ba430316b9 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -76,13 +76,15 @@ #ifdef CONFIG_LINUX #define DEFAULT_L2_CACHE_MAX_SIZE S_32MiB +#define DEFAULT_CACHE_CLEAN_INTERVAL 600 /* seconds */ #else #define DEFAULT_L2_CACHE_MAX_SIZE S_8MiB +/* Cache clean interval is currently available only on Linux, so must be 0 */ +#define DEFAULT_CACHE_CLEAN_INTERVAL 0 #endif #define DEFAULT_CLUSTER_SIZE S_64KiB - #define QCOW2_OPT_LAZY_REFCOUNTS "lazy-refcounts" #define QCOW2_OPT_DISCARD_REQUEST "pass-discard-request" #define QCOW2_OPT_DISCARD_SNAPSHOT "pass-discard-snapshot" diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 1fcc0658b2..59358b816f 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -210,8 +210,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 14aee78c6c..52d9d9f06d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -747,7 +747,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