From patchwork Wed Aug 8 07:10:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10559585 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 1EA6714E5 for ; Wed, 8 Aug 2018 07:16:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 065F628AA5 for ; Wed, 8 Aug 2018 07:16:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC79728AD5; Wed, 8 Aug 2018 07:16:13 +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 6AE6528AA5 for ; Wed, 8 Aug 2018 07:16:13 +0000 (UTC) Received: from localhost ([::1]:42153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnIhY-000867-J5 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Aug 2018 03:16:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnId6-00045p-9A for qemu-devel@nongnu.org; Wed, 08 Aug 2018 03:11:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnId3-0003CS-0p for qemu-devel@nongnu.org; Wed, 08 Aug 2018 03:11:36 -0400 Received: from mail-eopbgr700126.outbound.protection.outlook.com ([40.107.70.126]:54082 helo=NAM04-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 1fnId2-0003C9-Oa; Wed, 08 Aug 2018 03:11:32 -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=2Rptt42J+sckZtVEAJvLAi6SueWnBO8bJMzSCovJmjw=; b=Neru5wmMaQqVg6oLUWXpBbBSFUozKOJKADbgSYE0/XO0I6CSZCB77BHVrn51WqkFWfDegtnqtD/ue8WVXG4N2nCVOzS160nmFr1v1eEw3sN6WNFUr1iXX0I0VnfjUHKWh87sda9Et3yNP6EU1zoCSndy5onOUt2GRdwSZYncw/Y= 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:28 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Wed, 8 Aug 2018 10:10:50 +0300 Message-Id: <20180808071051.30628-5-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180808071051.30628-1-lbloch@janustech.com> References: <20180808071051.30628-1-lbloch@janustech.com> 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: 9c2a76e4-e626-40a2-4bf6-08d5fcfe2a60 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:AW9X8UNxB+JnMt2BgBkPVaGxElLycPIagKW6xO2cP5asUsgHl19QBszs7h80tKUstE6zcOAIu6w9RD6FXtVgGfxh7GHdvPQifeL5Go1IwRCptAZhm0VYmHbSShGpeeKNeTZBlwfpCseBZ4VCV7gOBgEXjS14FtPqiqZCUzy2uWzYsclyn3pk2SosBLcV1RY42DDU1SAPMHv/hrXU1MhXb4jLlU4o3m8F+iGgkfFSrm1a0ndZ5VnUxfcLiSqUoh01; 25:sLHMpxc/HoTIrKQTC3IFVjRjK4FACgHf6hy1MUQLsdGYFVejnxgguX+BEyv53mu06m8x2SXyIB6u6Wbh1qEHztxF4XjxKnv4odqhri819lTQ37DIHDgGK1b5x2E2tPlEoM2mUKUv2IBsXpUagUaZpmD5cvBjzGNwCfifdgTRduwzOB5ZfKG+xbuBu3rAezGeRfy7L4uBOMibSRrrzuarSaP4/MNB7x/BYvCG9pKqKHVqQLLYOt54BShMqRcOU+F3rdJB7oBtyHvI0MNPdFZglrLmTwTfmGt2svb/mbNssSS+NeQk0PdeRSFhevhzcVzLqh1RCNLogvCYf3Ep8O/T3g==; 31:qK8XzlHJNnVJdmKaenFAHnerHdIyYZ7WdMlPg0RzGvqnWAbKzUYIIwJsSRA0PPG5tKPFOqlV73yRp4RVi2ehj/3SvqzTuyOg0YESl1911Ny9qvwMAD3LaybIPgYr2JhEIEawb+6KbZiCli7v31Ga/ct+H8fk9op+efLPtb+SneDbZF2ygUqgUySrVXWTpEbuTj6FB/9nomvRESEOhv4B7GXVPrW9+aWz7VqVxZZD5bc= 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:UpSzQXqkimzC1hRn4Nl2LgjAaOsCr62+h/MS/ICcRfmow0Vo3PeBlDCzo3ks1r1zwDKEdfhHyKx5HheE/HSg23FJEKzIRYJ9DfoZjEFXlRvE1wkcaBkSB3Wq8c75UGksN+VXYpTB1+1G4epcqYsBMFcHlV+i14jglbFy+7F3kmFx9/0jTwB+D0iju1zfkoTHnxgEmX0Fl7nsZ1kXGHQO9TCuuIdEONhwiTkDWHzP0kpm2MkG4WtvqGxchwAMYqeg7tq+5ndoj+4lFYbb2o86aw== 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)(575784001)(105586002)(16586007)(86362001)(66066001)(305945005)(2361001)(2616005)(316002)(386003)(6506007)(2351001)(47776003)(106356001)(7736002)(76176011)(1076002)(11346002)(478600001)(26005)(956004)(486006)(476003)(6116002)(5660300001)(446003)(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-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2617; 23:2VL+LT8ypoAEuIkGMYrLvxfGGBceBQUqS41OCyXHO?= HILVVKny4U5Cd8U7wkbauASPHK02mEBIVqqyzUoDaRCzIEmljtUMKRsdxhf8WbWpPuLnrQlFiG/mk9ABkSbeYSrdpScIOwLaXINvAaMuSea3Tk06GiRO4UcRIcNRyDhdZPv5br5LVFowmUhVYgOCmFtWAzZI3FEDYjoZvjGLe6tSWZQx0hTy2ywMOb19ROds5YDZxgZZtcZCVf783OZojWKDKxysQfbiaxUT+Fmd5WlnilGSeELXNW4TA5uCOP4rSr00RiM/U4FfxtUH1qENI0MYq8LG08GQdLmHXNkRaWRog2pSDUR9bgVD4UDxYkgFP88xQl6uB3vX3PwEGBzLH139qztekkQsz4tkCzKx04QYUbmAxzvAOpeagRDf8qCeMTg62AkASwsc1f6rrJ7rI7IWelQ8K9Mo9slqX6YCcMqmq61edhKNER2ap4tRnGVB0kPDkZ7WAzor5tJzWybc72H5LgyxVf7HPJeffQSYcFKfdCZmtGvKoyUGcY/maTSrqpQtmf7BEP06+SSsK3tVvCe+pl+0B0jIZB+Aw+pUhhpr62l+bTjTtbg7yhKMupUJdl9ahYvgHv6TOIZ4llNT7juB7MyfFnXMVxz2HBqZCuFZtxINBrOAz7yx+TAUd1qKOQEddnhHTZHbDYpUVz/ZaMJV+exqPoSdny4JZkjpdHt8ZihEAdQSJp3Z/yIqBiL0uDwov4TbKkf74+uRqkOoOMBkcmJ0B+d0i+6/sg6lMyKRpOCbjr0Jjqnk3OrwhaQV+rco3dhwDcTbS1Z6RiFEvYFTifYNi45m81xAtUVTLl9UULKRYtlxofu4+pfyPL0whUCMQfrjlj2yNYFk4rmauI4nYIdUi2qvwf0AS7VuPub4XhhRsNC9hmS0cWsL89Uo+ecbi3EJ36aPqreplYiU/bKTqlqIEye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TDddqcqDwB/7cn54FzuKBvM4SNSoxgsPm8J1Ad/uC0JMdUGl/jHwCTNqFbe1yptR8Yeu8C5Ct1YcN1ohLPkriUfK5xE6mm0VTWjmk5tE2YCHti709Xv00FXtIDQx+tFhrqdVgbx1xIy9jvqZ52RR6lDWnGy1ewuiu0AxYg==; 5:y0QdnR64t96sE/vnLBQVZ4JZRdIv7t8zxGk9IVp8bJ4aNAaOitTfPQ3gUyBXeQ6XC3h5z/rViUMBwMI708+L2Zg+bJLr3oHqa9lmol+fEvwkySLifUCn4M+FJ1rQvOql1S9VfyvEph30YxxaEem1VIpNe8GA4Af8wE0Br0oX1B0=; 7:NOs4XzjaPpuzuvnUj8LJ6FcuHAYcs16oQgrwjQT92/6MAcp9oT4k7cCTY6Tfa+Nd18SdGaG3P90NCglp01okHX69p/33W6IMlXrZWSRDbvKlFGp6PQh0Gb66/MLZDcp/cNykTXl7Zjy/yuT9hGvTdxgOXHDwkyLHTkMsuBLipIfH9M7JlMcssCZN4exxmZDt1Wf01JonEr397XIlUJfIYLF+2HJpB0GlQUQG2TqFNeKKpyIWKoFN+Iwzp5YceuW0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 07:11:28.7484 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c2a76e4-e626-40a2-4bf6-08d5fcfe2a60 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: 40.107.70.126 Subject: [Qemu-devel] [PATCH v3 4/5] qcow2: Set the default cache-clean-interval to 30 seconds 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 30 seconds, 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 f60cb92169..453a6377ac 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -941,7 +941,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 d77a31d932..96a2808685 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -77,6 +77,7 @@ #define DEFAULT_CLUSTER_SIZE 65536 +#define DEFAULT_CACHE_CLEAN_INTERVAL 30 /* 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 c7625cdeb3..c795febbdc 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -202,8 +202,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 30. 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..f98cd14740 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 30. Setting 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 d6e15b2f06..a0e0763f71 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 30. Setting it to 0 disables this feature. @item pass-discard-request Whether discard requests to the qcow2 device should be forwarded to the data