From patchwork Fri Jul 7 14:30:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Butsykin X-Patchwork-Id: 9830579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D103160352 for ; Fri, 7 Jul 2017 14:33:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C359B28647 for ; Fri, 7 Jul 2017 14:33:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B82BB28697; Fri, 7 Jul 2017 14:33:16 +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=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, 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 F212B2869D for ; Fri, 7 Jul 2017 14:33:15 +0000 (UTC) Received: from localhost ([::1]:56842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTUJm-0001Yx-Uu for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jul 2017 10:33:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTUHq-00017m-VI for qemu-devel@nongnu.org; Fri, 07 Jul 2017 10:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTUHq-0007hg-2H for qemu-devel@nongnu.org; Fri, 07 Jul 2017 10:31:14 -0400 Received: from mail-db5eur01on0112.outbound.protection.outlook.com ([104.47.2.112]:58912 helo=EUR01-DB5-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 1dTUHm-0007fa-W7; Fri, 07 Jul 2017 10:31:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OT0eCSvye2J8NR7SK4ZrE0t5mefNxLssWFONXssi29M=; b=D/QnYalpw7TB+ml6yUm9B3Nr2pPaGyZN8U1yu0cW7MTvSNCIGbTWnoSx3P9gKJOojr/F5IPtWbcixd+6RztZuVdxAuhaJF+OlCH9X/WO59u0tlLETK0B/slAbsYxuVAS0Y779k0Nvs25VwFg8fpcjGzKjH+VolOVARWY0PXPQ3w= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.6) by AM5PR0802MB2546.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Fri, 7 Jul 2017 14:31:03 +0000 From: Pavel Butsykin To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Fri, 7 Jul 2017 17:30:26 +0300 Message-Id: <20170707143028.692-3-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170707143028.692-1-pbutsykin@virtuozzo.com> References: <20170707143028.692-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: KL1P15301CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:802:2::33) To AM5PR0802MB2546.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eda6a49c-de53-414d-e8ce-08d4c544cef4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM5PR0802MB2546; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2546; 3:AWqC/uNlrw16f4MwvArJNT+73gNTSM1FZLkulmkNdpznBY8W/p/ENUa5m9AsuiFD/7ziaaOD7acEEI6bc8IkKyspTd8SSfHIZ6swV+OplkmzKMShNezF4QhrL5Mia9HB48r9bwstlKUje/21t7OPOPMT2HeP25qYnIe+GGAD/kag5yY22l67I9YQQAoZHh9kpBtXcx+tsVf7TPc5/hDUla8AvznVO9MsIFp7tguPQf4TzUv5Qm3H4R4+GuEwJGmBbmNyCYicED9K6kdouC04BdOJQDQ1H8IsOiY5cb7xhkpAWZddtjtUd1NVCT5O/w4n00lfdtm9PSkkmck7bpdfYCzZG9FGUOEcigZr7OuzySLK88prl+yKqc6HXy2DLn8/IwIPBx0rKnQg+4vorh+jHKCae2h8xuS8CgC+dyFP2SDybvV2uGWMaXpSRWWrdkbk0q74ZbGIR1Ue4mL4Ij9cWkdF4rAq+rGA6i+mt20NY9kfJ+vx6Qmb8sBTiWWm1dfJzJU+PUvX0wUESztlhUJOMIt+g/Zahjp9VQDzitsLwyM8Fj0GOHtZDJ+N7qnkmxoDhkTDwNZJKXKKfI0fPI9DpJk0xgn706l22iWnvqTUayHERdE9Mf9hjMQdfR6qB4E6tjZ8CbTCT3dXOTRpywz6I6borEMaadWTxiTASF8+AsVOnH0EOShxpuTfaMxoxlvXPtzOxfPrD6buX9gUEP06x+ChbW6H7REWnryUrbV0zXqbNA4DaM/03D/xRBGZfkBI X-MS-TrafficTypeDiagnostic: AM5PR0802MB2546: X-Microsoft-Exchange-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: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(167848164394848); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(2017060910064)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0802MB2546; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0802MB2546; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2546; 4:09rIsbApX/WvZrNlDdoXxKbowiWxcZY7DredxwRR?= =?us-ascii?Q?Drg1IhNL5lEYERGJ8wnUTQEkifUe7GQfdVRgOurTGQTbdckkToKmVWjkJaj5?= =?us-ascii?Q?lNlDSRwrNEmWL53Wk/DsZmzpiRpqJxRs4H9LdAZw0b+k49tMW1IC2UPcS7wH?= =?us-ascii?Q?DXQvRvMtvSagPqKEJoeEBsEjJxrSLZeWcWit1XdIfCnxbQLu9ofV/S5oJL36?= =?us-ascii?Q?SrI2MKz/SY832Et+UUjHrsY0yr28XnLuesc/Bi+0RoCQWv/BmBgKCJxpVDg0?= =?us-ascii?Q?tNoxI7VIWjJjLMpgeNplQa3odANIFuCplu/Mn5rAXn2cc0WR4yV+rGJEsbN0?= =?us-ascii?Q?eN0Z/Ch9oM+sEysXno/PEYRQP2K+dWVFohhT/Mxgm1SFyfKzIdbHHuobk4eC?= =?us-ascii?Q?82MY5Cz8rgG929SZFnNOpYojBcxzfEK6QuRW+fUf6F6SIle82BjqOehhMjJ0?= =?us-ascii?Q?/g8R81YdatcMyM8k9MXcp4/uqwwmNqjtJ1tG4KFGXvygwygKqIyRfskWoQEZ?= =?us-ascii?Q?5buxvUauDgmttYP6S9VXH88hf4oN38uXXQdhr6Z0UU4s1I3VOT533lxTghEm?= =?us-ascii?Q?A6NlKZMrzP0t+uYD7dSBbO10BQdSKgUqXT4YZy9pemS8oNKlRjg2PIXsy1h7?= =?us-ascii?Q?7uhZ6y0k/2kURO+Ms+J7AERJEnMiKjwfU+WMlz45L6nU9OV6c9aXo/Q2f61r?= =?us-ascii?Q?wjBqjBvyGTKv1mLOoSQw6f8PGP01DX54VRckL+tZ2lozGeaq+FQxazBgvHdp?= =?us-ascii?Q?iTEFmgKWocYDSHZ8lz0jWvd3J5QrUVtSmI7HPlm5Bwc5Bc2WPadvGjwtVvwp?= =?us-ascii?Q?/pPjXMIjC9drXY7gimP3L42L6iVJ0ke/ynUSMA8jr835MrI6swrx3NEj35NZ?= =?us-ascii?Q?bR0RiYT56E339lSs8HQlFB9Mv57A/C12MS13mZ0cCrbWOJl3IGKwr1FArM4o?= =?us-ascii?Q?SpxF5rv4v9xiVwFKo6DmHi45nrpfv2+Ms0V0FhA5lDvBRhJW3EgaokhN3fQ+?= =?us-ascii?Q?qmq//WYJeQMfrMmIXqJ4ouydQB5l+vbUA7wuktvWjd2BurjFsPlCoAAN0qN2?= =?us-ascii?Q?9ursR/D0Wfnr47aSWPTqbpBgM3YLzWY8GuBCJOJSVwflEiLNf3kQzX6II5cE?= =?us-ascii?Q?dVC78yN2TZSrJMfL/o+DnXS728h7I3eWys0x8cwij3KM7Qk0PRCt6EZ+0YmJ?= =?us-ascii?Q?fFBp8YK8YuLwwsUR/+rBFYRsoWiE98BO1iYsL1NeqfrDhFdZZqO06iAcZT5A?= =?us-ascii?Q?+ca7pD1z1GR1jeHTNPy6twblQ7as0RgvfdpQ2sop?= X-Forefront-PRVS: 0361212EA8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39410400002)(39840400002)(39450400003)(39400400002)(81166006)(36756003)(53416004)(8676002)(42186005)(50226002)(5003940100001)(189998001)(33646002)(6666003)(2950100002)(5660300001)(1076002)(47776003)(76176999)(50986999)(6512007)(25786009)(48376002)(50466002)(305945005)(3846002)(7736002)(6486002)(53936002)(86362001)(66066001)(6506006)(6116002)(38730400002)(478600001)(107886003)(110136004)(4326008)(2906002)(15760500002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0802MB2546; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2546; 23:ijzeIGy0G37FRRDJcticWQbKUCbJ2Og3VY/hQAt?= =?us-ascii?Q?A4LPthPgGwQiza4yyfgfnWy8Zdy5qB9f44Y1aJT7acsm79cEPAmr2Z2rhu2u?= =?us-ascii?Q?iddABsWTBd3/Nw1X9wUK7b7R7yZzBJgjzPBxNtRhW62Yds1M6nLz+ltq6KPP?= =?us-ascii?Q?vYYyVaeSaRBPV2yuDfeAIRiXtRnmfFj9hmFjALDXy02a9sqfdgDJW3HtOkY1?= =?us-ascii?Q?gp+/EtMUmnO01wwTfkr75a1ymDL872qGy5FuYvgzjnoTy//gH2QojrlhXOp3?= =?us-ascii?Q?K+durVzKJuXmK+rrxxgiSq8Xf9Jz/jjEn01oZFIwtVq6STdtzq0il0SDRrTn?= =?us-ascii?Q?YsIqNPIuTq+69QfRZsGSX2wL/HHUdB/QynUJEcBH3X2zx8UIbuNBA5xXLheh?= =?us-ascii?Q?fFyse/yubZmYn52kkGl+Pb9Wln9z1vAzCBjS9g6k4RU6QochgoFtb57OObj5?= =?us-ascii?Q?vyCXruhTyqDv1cmaYt2esnzYd1lcLTmYXf0vWF/+X4ujHoaCjTwRbGMG8/AL?= =?us-ascii?Q?A97wAmRBtsVdjPgOwRNAK4RaiCKH24rrwcbeKWmMAHQPQvv7Ryi7m9tdJEtv?= =?us-ascii?Q?s2EZAUESlW4jzie33p1sUtu0PxMOk8CQB8hBnAREptoYKNfAWyGM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BNUUt7cAQuk4evT64l7JmUNW391mwP+WHRZqp5/3NBTPp7nyfzWEATc+rDxphjVVsg+I0wNlsaPsm3j/buqH/sWgihr1115nxRnzBXuuQ97THx6KK9uF2iUnXW+CGOAYgzFaUViZJKTTvR3PRYP7j2Qsr+WIsEPasBo6o116Dsb01LIGDeX1HyJnnrYvkc4p4E= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2546; 20:ADi3HIQ2F6C7T8WRDzE6uR70Nz5sHtm7koss6DkGUKu1c6JYbrh9FOdn0PxhT9ANKzQt+M083pei6yN/BXNuF3LqbR8mB1ajRCr/incn+JRhB3mfDAUXD7yN8KTWcuRiAlZDFgdOnz2Qrw6EBg8JweZt9PjtyU9R2mvgvF4ZUFU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 14:31:03.8249 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2546 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.112 Subject: [Qemu-devel] [PATCH v3 2/4] qcow2: add qcow2_cache_discard 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: kwolf@redhat.com, pbutsykin@virtuozzo.com, armbru@redhat.com, mreitz@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent data in the cache with the data in the file. Signed-off-by: Pavel Butsykin Reviewed-by: Max Reitz --- block/qcow2-cache.c | 26 ++++++++++++++++++++++++++ block/qcow2-refcount.c | 14 ++++++++++++++ block/qcow2.h | 3 +++ 3 files changed, 43 insertions(+) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 1d25147392..75746a7f43 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -411,3 +411,29 @@ void qcow2_cache_entry_mark_dirty(BlockDriverState *bs, Qcow2Cache *c, assert(c->entries[i].offset != 0); c->entries[i].dirty = true; } + +void *qcow2_cache_is_table_offset(BlockDriverState *bs, Qcow2Cache *c, + uint64_t offset) +{ + int i; + + for (i = 0; i < c->size; i++) { + if (c->entries[i].offset == offset) { + return qcow2_cache_get_table_addr(bs, c, i); + } + } + return NULL; +} + +void qcow2_cache_discard(BlockDriverState *bs, Qcow2Cache *c, void *table) +{ + int i = qcow2_cache_get_table_idx(bs, c, table); + + assert(c->entries[i].ref == 0); + + c->entries[i].offset = 0; + c->entries[i].lru_counter = 0; + c->entries[i].dirty = false; + + qcow2_cache_table_release(bs, c, i, 1); +} diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 7c06061aae..0141c9cbe7 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -767,6 +767,20 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, s->set_refcount(refcount_block, block_index, refcount); if (refcount == 0 && s->discard_passthrough[type]) { + void *table; + + table = qcow2_cache_is_table_offset(bs, s->refcount_block_cache, + offset); + if (table != NULL) { + qcow2_cache_put(bs, s->refcount_block_cache, &refcount_block); + qcow2_cache_discard(bs, s->refcount_block_cache, table); + } + + table = qcow2_cache_is_table_offset(bs, s->l2_table_cache, offset); + if (table != NULL) { + qcow2_cache_discard(bs, s->l2_table_cache, table); + } + update_refcount_discard(bs, cluster_offset, s->cluster_size); } } diff --git a/block/qcow2.h b/block/qcow2.h index 87b15eb4aa..bf6691dbd0 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -604,5 +604,8 @@ int qcow2_cache_get(BlockDriverState *bs, Qcow2Cache *c, uint64_t offset, int qcow2_cache_get_empty(BlockDriverState *bs, Qcow2Cache *c, uint64_t offset, void **table); void qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table); +void *qcow2_cache_is_table_offset(BlockDriverState *bs, Qcow2Cache *c, + uint64_t offset); +void qcow2_cache_discard(BlockDriverState *bs, Qcow2Cache *c, void *table); #endif