From patchwork Tue Aug 7 20:21:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10559137 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 6B437157D for ; Tue, 7 Aug 2018 20:23:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5998128E09 for ; Tue, 7 Aug 2018 20:23:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BD1F2A6B5; Tue, 7 Aug 2018 20:23:56 +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 BEF8228E09 for ; Tue, 7 Aug 2018 20:23:55 +0000 (UTC) Received: from localhost ([::1]:40707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fn8WI-0001WF-V0 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 07 Aug 2018 16:23:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fn8Ul-0000Dq-5j for qemu-devel@nongnu.org; Tue, 07 Aug 2018 16:22:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fn8Uh-00089m-7g for qemu-devel@nongnu.org; Tue, 07 Aug 2018 16:22:19 -0400 Received: from mail-by2nam05on072c.outbound.protection.outlook.com ([2a01:111:f400:fe52::72c]:22811 helo=NAM05-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 1fn8Ug-00086y-UB; Tue, 07 Aug 2018 16:22:15 -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=ziA1YsklL4k7LHLFr0hfWuYaj4WR5clhZjBOP1QFUAc=; b=joe58vKP+pJurB97wIVDKxO5XR8f//VKlXfmEKg5WJgAU5SPy10R9FlNZtt0+0CAahGHpLDd260QWgzjeGXvJ19I5WFqoXScR8z45OXJ+yRBe6jXAJ2HJGAWMKo3vdjut6npYPjs7Ta1YeO+HbdvtBjoNuK4AZBrQbx+BFXPmEg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by BN3PR07MB2609.namprd07.prod.outlook.com (2a01:111:e400:c5f0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 20:21:54 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Tue, 7 Aug 2018 23:21:21 +0300 Message-Id: <20180807202122.27006-5-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180807202122.27006-1-lbloch@janustech.com> References: <20180807202122.27006-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: VI1PR08CA0126.eurprd08.prod.outlook.com (2603:10a6:800:d4::28) To BN3PR07MB2609.namprd07.prod.outlook.com (2a01:111:e400:c5f0::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05822818-27b0-4a4b-52fb-08d5fca36b8a 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:BN3PR07MB2609; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2609; 3:USlFy2KW41XafkbUQXQFqeYkIC27unghC+t7mZgvM4oFgSgBAmv9FnW6ug+T8UQkNmKlbQSqUy01rq9CHuCpoe4npofioYd7BmNSwpQHMXam5OPg+legkIFYwAHnX8AwuaPYTCFyiXIOnfeLGlHmZP6W4pPU7KazFFz/yfMbk6IiztxAuCrTl2+4BPxA/ect4a8WKFqIkh+KxzsDfwrXLHtcnVNInRVavagsKRuj4JRJw8P8q2yT2VfYEcAzOqjh; 25:SdE3zad2y4ZUlr99jw/gW+qc7M0oY0ciGoBmh4d5JIsdCrWsYO9MmFsFqwLGNsr36L09szueFrXnS1dhy19Rl2iUIo9MxcvKYKOlz0o5PU1KLFyGi7c1KECgqmR9llvjKACJ+lYXFvF/ViGAZPZ9sPESEXB6PVU7ke8a2sfGNSG/oLJ4moulaMYiJZWDGFu0HlBB5jeSOYfji6dNWM8psPUoKQ/PEZb1xdfI8E5sPwCY6ty/BWuUD058/DXjJ/9TfDC11QDVSaHbBp95Ol1YAR3c0mo1Cdj9WlaezNYY8VxG2fZE9JhdYlncMQGgSAcRT+Ku8K2a7Was+ruZtVdr4w==; 31:93DNMYNyV3rf6vWduqfpJ8pd2D+Qg+M6TmkimGqj97cboZus+guKXOfluIxYAIgAUX6YE/HDfLfwCibz9EbGUOLseBSm03jautwewr7oY4MYgc7idn1ZBWo8Pw07ficskoNKeQ1VrMTnHARUNJtWZG+RXKOnhQbkoFOdea3C5FF8k5yIhCp1zrHm1o2B4037kGTfN/zSyMQ1XBYNi0lttDPnXQrEcQEZ94/eNSmmO3g= X-MS-TrafficTypeDiagnostic: BN3PR07MB2609: 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)(20161123558120)(20161123560045)(20161123562045)(2016111802025)(20161123564045)(6072148)(6043046)(201708071742011)(7699016); SRVR:BN3PR07MB2609; BCL:0; PCL:0; RULEID:; SRVR:BN3PR07MB2609; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2609; 4:5IOzFSkdL0hT83uYqf2Bv1L3YAqqrOz2tUM6FMhAWt4d53c2q65g33eg9yxztTqxa5p32ojJv5jkGUK3LHoAEm4va25L/K4mBweZ+Cm7Ar4BZjEn7aD2UszkepY6CUHOyGjnaLKaIbUrGWW3Thu2x0O6aMoxruF0P0R5xh1K0UYnOb7Pkeyc7xOgaCSOx7wJV5rFvB0g2ujAyWGYAqnulHX2nJsut4aVD5pNZRg9b5IpdfVaiX+S3f3XL4A/Wc7FhhM2zQ+1x8SL6VDl3EEThA== X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(39830400003)(376002)(136003)(346002)(366004)(199004)(189003)(47776003)(446003)(66066001)(956004)(305945005)(11346002)(105586002)(48376002)(76176011)(486006)(50466002)(106356001)(7736002)(5660300001)(2616005)(25786009)(52116002)(2361001)(51416003)(2351001)(6916009)(81156014)(81166006)(6666003)(476003)(36756003)(386003)(6506007)(8676002)(8936002)(16526019)(50226002)(16586007)(26005)(54906003)(316002)(68736007)(186003)(6512007)(3846002)(6116002)(6486002)(97736004)(1076002)(2906002)(14444005)(53936002)(4326008)(107886003)(86362001)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR07MB2609; 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; BN3PR07MB2609; 23:3e6mUaeMc0XVtGYhMIX/G3WOTQI3Q+5GQ16fHIp1v?= Ehd04QyXrUavYqXLsxsAT8fu+ciYp2go+xwL5SZuOVVR+1nHqeSquErWIHFVj83C97BUpD2SE/Yy1CwQPT+WdkpstKRvBfPz76uGtEv6yK42qS4FhI//eUOCHfrzTgVDqAbDnpIdWE8Pq/PjWfPSE59pWx4RZQj0GHuoot2wN/ziQqzVLiNMoFWGdBv/kFyPEqOOZbV8x5zmAN1zm71MeHZ/wg264GT2853citRBwonaPQEGqUgj0ZCAkpePE7RWKIhBb7PmUOkWK67Mj0DJ2iXSkeIbhrGkGdNLP6iXJVNSCaEGXwvz36C6Dj8JGUMPszXctloBrqf1ExcQFL8VT7fla7JMKtAb2FkMpDk1ndTEHfmChBIG/n1Za1/KGsMGnQxEnPRkwJREt/DzvsXpIlVBsUrblmO8ZLLv7nq+Q2Lmn+KjLvGvra5WkfNMiA1VEWBBPJcyQ2oCp0MVMOpd7eTZ9mXnBzsa5KZgj/vFNFYh9Q1uAf1IXhiUjm+Mrj7LtNwT6S8Fi8cANu7JzwaiiLDHnseXkmhI1PaQ2jLTYfGNTYMoq+5ySMtNgzTYB3x9B4mRW96v6mDCE54EmswZjaBoh6GYCVUwl188NOg6NM0JQrF5QoTLYuNfNCgspXL32OfNz/orfADfC/IdV9VWrmtv6gyHu2Kc6eDxsiXV8ySpjbcj/P7z9Ja7sotfAi1nEAym9qhvzEKjJ+UnsAkEEHBBGG3eCAyB7BMyxLeuuGSEkRUzH180uxviar1Wh9BitkN6kgd2VYl8gHPBsT9N0/v0PlfupfEgOa91i0aohQ0bmIP5k62wIaK7glSf9AxE8ysaopNSXYFICNrmjYEusxIg63g6RJUDrWUG91YQbdvEmtkQDwfXBz4D8lTJUiGha9Pf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O698K1MROmRk6Nq3nblD7x6ymANCCvVbesliXAUlmPuq/Jhd/SbOBFn1OyoD5UNyj0NwNXq+Hpj9Q/sj7YSB5tBir/iltyaYq91hmBywpjz2sc3s/nu+73tALam83zTxELKBBwJ+d/fWEu7rqvNyAXYGS/tXhlvWix8v/KK3gBEc+NMTaZDJBeA==; 5:fIONkk1ke9CTMkhHZfHHr9NqiXs30VgU1IBGv04QORFMomCfm9sAXwf5unnzPpIzuRbrZJLKJqDlmCxg4t+uPqe7uupAFafzRzbGsP+4O/jWqYiudJ7s9MptRclkBeLSij4DasEJ5QjKa1lKUD4qqhZgQw5fPmbgT3N6ewKuKzM=; 7:P7uKke26SyVW5H0gCMEQZJF7lD6yHpEe243t+UBkWb+Ekh7vIG/Y4y9xoVRmDH7PtyhXLCqgj8J7EWPzXq5vjxwuMJ4w6zPY5/jLFzTmp4HA88a/0lmD7l85fZn7zHxgr+3vYGMRpiMsxkVA5Tq9BlSm2FeO45QOgUNKpb8iSk+M7UMs/IwzO4G+dhEMz9EPbZFUaaHzr6YRiouUrQzRnovo97nZ2k/uj2WHsCnzdhTEUmm2/pRsPKKa62iy112q SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 20:21:54.1456 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05822818-27b0-4a4b-52fb-08d5fca36b8a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2609 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe52::72c Subject: [Qemu-devel] [PATCH v2 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. Signed-off-by: Leonid Bloch --- block/qcow2.c | 2 +- block/qcow2.h | 1 + docs/qcow2-cache.txt | 3 +-- qapi/block-core.json | 3 ++- qemu-options.hx | 2 +- 5 files changed, 6 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..1e6711a63a 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@ -202,8 +202,7 @@ 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. 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..4d8fca9128 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. (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..0cda3d3c3a 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. @item pass-discard-request Whether discard requests to the qcow2 device should be forwarded to the data