From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 886228017D for ; Tue, 27 Oct 2026 10:20:31 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69RAJBLL024668; Tue, 27 Oct 2026 13:19:12 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RAJBLL024668 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="lzPbbsUW" Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69RAIqor024633 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 27 Oct 2026 13:18:53 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RAIqor024633 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-8a88d53c7a6so82592387b3.2 for ; Tue, 27 Oct 2026 03:18:53 -0700 (PDT) X-Gm-Message-State: AFq9FYIeWL1t/Xf8a7kagbit63+vhjnPDfh4A4doHf7Ifjb79f9Eprd0 /cObcszUgOh/Cfxd+xW4oKoqnKMxOflwfVC122QNxkLjq6kbWzJAkjpXhZh3O98X/wppICFWy5d iBI+svj5a7DLXm10s7nRh8dzK1jAU/ge7RX/vi+uAWDenSqBtG1BxyA== X-Gm-Gg: AYBFou3WvisjLl/JmxbWKPBoDE1SUiBtEyvbR6sHMJbORUwWrg+WVuC2NqBI2QWBjLl nVCZ/S5YgKH+ugZGL7TCbPIKvXALzzC65C+mpEoQN/CwRaoqxU3GgATVqaT3ZJ+pt/PQnAEVAXl ik6aCPT2DVhRfB+OSGdMJL/YjjCMbDVLAl0MXXv6QePRk+GrDttqF/GnaqtShYkUBq9yiKiMiTI UlYPtT8t4zuh3d06qCQZrYwdYVdsy9bX3cyYvnizE4OMJM2jJCrDiVgeHgwEhEJAPYD+hVcWSn3 uDVEdZB8ihHhqm/BlfOrOrkkPQzSLbmS4U20zpsOowDOvHfjYtSdYE1lxK2LCshuEX2h9DJxT4M Upn3uZzjHFxNTB2FpK9lU4BhrInlPHnSLRteXSKhWY07Ssp/5rNGnqOeVcd67gq6itnKV0wPaas HCXEVrvfMpvdd5P6bFAchAJTTt X-Received: by 2002:a05:690c:79b:b0:8a9:d5f2:f5a6 with SMTP id 00721157ae682-8b166c13159mr59236857b3.67.1793096331894; Tue, 27 Oct 2026 03:18:51 -0700 (PDT) X-Received: by 2002:a05:690c:79b:b0:8a9:d5f2:f5a6 with SMTP id 00721157ae682-8b166c13159mr59236747b3.67.1793096331162; Tue, 27 Oct 2026 03:18:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1793096331; cv=pass; d=google.com; s=arc-20260327; b=jZPlGwjDyOOIP/ctAwJF1kEcXElj4L5WhWuyudkWjzH0ntkPTR7g0KI4YUGKiDV9Ie ps28Xs1Ds9Y26prUDIaZfERFSLwnSMNDmPPdRdFOl/Fw3EAIoEjqJCZeyrgZVtdmAGgB T0TzfXV21eomh4UBFi8cdqKfcuokg+erp76luvi2mM7lZNtijm6cW24TGNNPLWp7T36Q 9F/3b2j3/BKpsmxIS6sPddY+OQWUlBLuzPfjkceVV90XIYf77Vk4Hdw1tF2+OUgrDagY BQrx+75b+riLwVz2XpG2xngozerEsAOIHqhhLMDPo4/3JLz85b6t6kYTMJ3RawT6ez8J F+Tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=mime-version:cc:to:in-reply-to:references:message-id :content-transfer-encoding:subject:date:from:dkim-signature; bh=0l3Kgktcqomog/ZQmLUdkl826CGPlegPLP8aNFYIvE4=; fh=y3TfVeQA9QYtIzD5Inxiyys5ebBfyOgjQPZaP/+mSiI=; b=EKnkVSXY92ikDzRjG130drwr4ANaXyjGqrsTQQQDAfunOkCch7UKZx8gHJJL4e+Ewd +iUhdmlKMJg5kZd6cEciXMZ4FaZ4oPV5syv0ZWiyl65K4f+rXaTOfvu0Ux7MAu3Ty9sD DiYeY0x0bL+MzXKT5OZCbrvGc3SdjDJ5xjHOeEVsiQHx3LgbCKrlb87O5XEjm62c+vq0 jxO0Ge4fYa1lwm1sBrSlWknCBGulUw8p9pgfG1/tc4QQll7mMFo3S8lbVApVJCk8eBx8 dwTVGkikr8TUdpkP6qA0RS56qTSJz0MDAKKnB6a4Yimq/6SNCoWaVTGQaheSthevtWoc zWnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=lzPbbsUW; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.com); spf=pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c201::1 as permitted sender) smtp.mailfrom=ptikhomirov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazlp170100001.outbound.protection.outlook.com. [2a01:111:f403:c201::1]) by mx.google.com with ESMTPS id 00721157ae682-8b19e60db17si13622047b3.115.2026.10.27.03.18.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2026 03:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c201::1 as permitted sender) client-ip=2a01:111:f403:c201::1; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=lzPbbsUW; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.com); spf=pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c201::1 as permitted sender) smtp.mailfrom=ptikhomirov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z/d2JB+4xxNldKQfs2TpTvSDbOPFwu1YHzWMC1UFVjDlljbMARgHklxltdJjO0wa5pYAG8mjE6ia9PYBvW6jdi4MUwbP5Apof9KNR1A7GLWUlGNpclrBce1UfNPyrsbq3WIAi/5OP0TwlzBoBZYQ9PhoARHnKY4QmwQq4jaWq1qLtzVRmhn78xzjMse2J1yU7tHbXeK0ReVrLP5ceGSN7QfCl51w4BJ2+V04ZTAlx+9PLSio+NgzfXeEFWWPWUMikZOFkSz+ja+BJNN/w9Z5mDkhJHrMUzoCsSS2p44brh3PP6i9o+MPnckZLMpIuKn0rAivQ/I4EG4gAqZCEa0CTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0l3Kgktcqomog/ZQmLUdkl826CGPlegPLP8aNFYIvE4=; b=LIfNwyP8yIWiZqcQ1/ZbGN2zuecWlC+gXEPAUeIzwbIWbCzzVcUqEK0Dj+7Ux7a3iZzutEx48/FQzlxnoAf/iehAze7Pgj5qEi8tIUat8X3N70p1UtP0655M9E1TQduZCBsO/4j8B/YgTMgvIB1L8uRzqOB1daD8yme1n8cW77DpGsnSF2ryHvZv7DbOG/MNHId70q+EJCWfRWAg0Gdz7Ct8TP6Xea21d2VOHIMWvCxEUlIVKUfuJfTGwQpCUFzC5m1pAXJ8E/OLEfhKj2IUtiJHAg6ygB5PxQ2AJHhVpSLRQG3VDXv/RWl51/Ib1YJgtPlcuW6PxkL5uoH9bSXluA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0l3Kgktcqomog/ZQmLUdkl826CGPlegPLP8aNFYIvE4=; b=lzPbbsUWgKTvEOAIpyHMFKWBnLO9NNF9NW1tIaH/RvQyjW3glhNwyPyitNX+TLpnNAOv7UZPxQIK7hcupaacAvGw+MiyCxagPewsNDzKe3zkbt+pGiwH4LUm5xs0nXgMF88t9Da7wgWgrDJsftz/peq89wZ1+D3NydZaqHJoQhMPxRjHKPZa3uPv9d3tb8j4fcUUMjpwlupDNN5Dv0Vai8Lg3l2CiqOvVo2orI3Hz+noo9xDTDx4BIliwBezUXa8T16DnXE+Nte19Jsq8KKMIhkIK/YSpRHaj76pBIW7Qr7Bbv324nvr+KyBoyLe5WV+bQvnBRyXvaL71JRMhuualA== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM0PR08MB11804.eurprd08.prod.outlook.com (2603:10a6:20b:747::14) by PA4PR08MB6208.eurprd08.prod.outlook.com (2603:10a6:102:e5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.22; Tue, 27 Oct 2026 10:18:47 +0000 Received: from AM0PR08MB11804.eurprd08.prod.outlook.com ([fe80::bf46:f137:f6d2:5b3a]) by AM0PR08MB11804.eurprd08.prod.outlook.com ([fe80::bf46:f137:f6d2:5b3a%7]) with mapi id 15.21.0546.021; Tue, 27 Oct 2026 10:18:47 +0000 From: Pavel Tikhomirov Date: Tue, 27 Oct 2026 11:18:42 +0100 Message-Id: <20261027-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v3-3-e1bc61a829a0@virtuozzo.com> References: <20261027-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v3-0-e1bc61a829a0@virtuozzo.com> In-Reply-To: <20261027-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v3-0-e1bc61a829a0@virtuozzo.com> To: Konstantin Khorenko X-Mailer: b4 0.16.0 X-ClientProxiedBy: BE1P281CA0181.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:8d::16) To AM0PR08MB11804.eurprd08.prod.outlook.com (2603:10a6:20b:747::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR08MB11804:EE_|PA4PR08MB6208:EE_ X-MS-Office365-Filtering-Correlation-Id: 65b87b18-4f66-4558-75f0-08df3413b01b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|23010399003|376014|52116014|366016|10070799003|261026140227099003|56012099006|261009223027099003|261022105027099003|261021121427099003|261022075727099003|10067099003|261021123027099003|22082099003|18002099003|261026121527099003; X-Microsoft-Antispam-Message-Info: Cs6ytBhsE3714uIPTMnFnXsGmsqe9Ti4stXhqt63TpB67CvB2Pnh3tX5GvZ/ShZm9EsUUHzfwvOwirWkbJ8oQ4ITugwmfsEjhtyXxELi4rnsYdft5sTdEDSqm5Z5x44dtr+FFdeODQAk5GDM31SF75UrEgR8fyZToOuyLeIRTCTFooJBRbTmgEKvR/Zq4D6hK33WGwEOTue+FGMnV/K+HflR8aCsgOBADDZTvf1tylimnuNF0m7UuKkNDg3ZxvQ9DTiRCdBFyx61/RkUP9nE7c8zkzRoEK740egzyZnZWLDLUePaDkfGWlA1pJp64hFNU2mX4LdoRgnpW8PFSUZnLubJZk+F0MaDQRLTTB0Ff9I7XJKjsLonnfJ8o8DnZ8wNzZhSfM/pA7k/Gvey2BxWV3oXbAKf2Fsq8jsk3LZdzydqBiYhJMy5/WsD8nuTszQS+YOlon91bwHA6CSt/ViChXMgePptzaoMpN0adfqAdkUZXRTJvvkvHVBUBDHUstvDbfn+WZ84/ghoDHwYB9ecG95p0YMCucewWejYuF7UIZJC2NFsBj3fmtDAdcKMK5eNjA3v702NdzQ0J35eWLggKVMdvPPFNoDZ4SElg+2egI7ZY33n0VquhCHdtMy3XXjG X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR08MB11804.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(23010399003)(376014)(52116014)(366016)(10070799003)(261026140227099003)(56012099006)(261009223027099003)(261022105027099003)(261021121427099003)(261022075727099003)(10067099003)(261021123027099003)(22082099003)(18002099003)(261026121527099003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?V0NiZXdueHV3c3YvK2dFcWwxU1NiSTdNZ0NPV1lIWFRNd2pIc1pFZnhBSFVy?= =?utf-8?B?Q1lUWTFkaWM4RUMzcWJYOUxic3ZRMTRTWFR6RGlPV00zdHFuWG9PVHNxZk9a?= =?utf-8?B?U0REY1hNNUppZUdqQm5ib2VFTnNYU3l6SGJxU0hhZ0pwTVlUTUJRRlBzTElj?= =?utf-8?B?bld6ZFB0WUR1NVdUTFk1TlVPekJuTWxpVElSOVp0UFZOYjY3dlpmN1pmcm1i?= =?utf-8?B?NEpubTVIenBadnRYbGlscUlqRVpXTWFZcFpZeC9Ia3krMENhU1RkcStId0VI?= =?utf-8?B?UEFBNkNpd1dJekFIbTFJTTNIYkxNNVdtU1VPNEpDWSthemMzOUxpMHBIMU81?= =?utf-8?B?czRpWDN1UzhDNVAwVDJvODJDS0VjeDF1M2VhUE5QUFkxcU1SVVpuUFZ6NXNl?= =?utf-8?B?RG1OOUU2ZVhnRUdISmFqL0ZqSlJPcmEzSGQ0YmZtUWVwdlcvSk9BMy9sL2Fi?= =?utf-8?B?T1pEb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UVBhMExNMG1xWHQ0VzMz?= =?utf-8?B?QVMrb1ZqWC9FaXlOa3o5QVR6bXlra0xHdGczbTVodG42YVJiQ0M0WnNTNXJF?= =?utf-8?Q?adiBuLIuXX3KDMhMVSnv73pA5E2tje2P1brA0fcmnoxCv?= X-MS-Exchange-AntiSpam-MessageData-1: SQbbfOaqdO6c6GrK6CejgZWyepfFlR5qfNk= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65b87b18-4f66-4558-75f0-08df3413b01b X-MS-Exchange-CrossTenant-AuthSource: AM0PR08MB11804.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2026 10:18:47.4202 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FeGj3qzlUDBdaMIdYZITW92S4RUxlcxRDNuRGfQ/inl8vfdPY4e6PwUKT7VRR+WrOJ05vOm/HdVSLXDNfGZr6pzvsiCEE6sTnRxq8auSOxM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6208 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v3 3/3] block/blk-cbt: account a write request also when dm starts it X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org CBT accounts a write at bio submission. dm suspend of request based dm waits only for started requests, so a request submitted before the suspend but dispatched after resume is accounted before a backup point taken under the suspend (BLKCBTSTART, CBT_SNAP_CREATE) while its data lands after it. push_backup then saves the old data, and no incremental backup copies the new one. Account a write again when dm starts it. This runs under the dispatch rcu_read_lock(), so it can't allocate: it sets the bits directly in the bitmap pages, which are now allocated already at submission. A page can still be missing only for a write submitted before BLKCBTSTART, then dm returns BLK_STS_RESOURCE, so that blk-mq dispatches the request again later, and the page is allocated from the kblockd workqueue. https://virtuozzo.atlassian.net/browse/VSTOR-149268 Feature: cbt: changed block tracking (for backup) Signed-off-by: Pavel Tikhomirov --- block/blk-cbt.c | 177 +++++++++++++++++++++++++++++++++++++++++++++++++ drivers/md/dm-rq.c | 3 + include/linux/blkdev.h | 5 ++ 3 files changed, 185 insertions(+) diff --git a/block/blk-cbt.c b/block/blk-cbt.c index 1066b6a33b6b5..7e3c354941aae 100644 --- a/block/blk-cbt.c +++ b/block/blk-cbt.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +53,10 @@ struct cbt_info { struct page **snp_map; blkcnt_t snp_block_max; + /* Map pages blk_cbt_rq_start() found missing, see cbt_alloc_work_fn() */ + unsigned long *missing; + struct work_struct alloc_work; + spinlock_t lock; struct list_head list; }; @@ -221,6 +226,24 @@ static int __blk_cbt_set(struct cbt_info *cbt, blkcnt_t block, return (pages_missed && *pages_missed) ? -EAGAIN : 0; } +/* Allocate the missing map pages for blocks [block, block + count) */ +static void cbt_alloc_pages(struct cbt_info *cbt, blkcnt_t block, + blkcnt_t count) +{ + unsigned long idx, last; + + if (unlikely(!count || block + count > cbt->block_max)) + return; + + last = (block + count - 1) / BITS_PER_PAGE; + for (idx = block / BITS_PER_PAGE; idx <= last; idx++) { + struct cbt_info *c = cbt; + + if (!CBT_PAGE(cbt, idx) && cbt_page_alloc(&c, idx, 1)) + return; + } +} + static void blk_cbt_add(struct cbt_info *cbt, blkcnt_t start, blkcnt_t len) { struct cbt_extent *ex; @@ -236,6 +259,12 @@ static void blk_cbt_add(struct cbt_info *cbt, blkcnt_t start, blkcnt_t len) __blk_cbt_set(cbt, start, len, 1, 1, NULL, NULL); return; } + /* + * Preallocate the pages for blk_cbt_rq_start(): it runs under the + * dispatch rcu_read_lock(), and a missing page there means delaying + * the request and allocating the page from the kblockd workqueue. + */ + cbt_alloc_pages(cbt, start, len); ex = get_cpu_ptr(cbt->cache); if (ex->start + ex->len == start) { ex->len += len; @@ -266,6 +295,145 @@ void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio) rcu_read_unlock(); } +/* Drop a cbt->count reference, release the cbt if it is dead */ +static void cbt_put(struct cbt_info *cbt) +{ + unsigned long flags; + bool release; + + spin_lock_irqsave(&cbt->lock, flags); + release = !--cbt->count && test_bit(CBT_DEAD, &cbt->flags); + spin_unlock_irqrestore(&cbt->lock, flags); + if (release) + call_rcu(&cbt->rcu, &cbt_release_callback); +} + +/* Allocate the map pages blk_cbt_rq_start() found missing */ +static void cbt_alloc_work_fn(struct work_struct *work) +{ + struct cbt_info *cbt = container_of(work, struct cbt_info, alloc_work); + unsigned long idx; + + for_each_set_bit(idx, cbt->missing, NR_PAGES(cbt->block_max)) { + struct page *page; + + clear_bit(idx, cbt->missing); + if (CBT_PAGE(cbt, idx)) + continue; + + page = alloc_page(GFP_NOIO | __GFP_ZERO); + spin_lock_irq(&cbt->lock); + if (!CBT_PAGE(cbt, idx) && !test_bit(CBT_DEAD, &cbt->flags)) { + if (page) { + cbt->map[idx] = page; + page = NULL; + } else { + set_bit(CBT_ERROR, &cbt->flags); + } + } + spin_unlock_irq(&cbt->lock); + if (page) + __free_page(page); + } + cbt_put(cbt); +} + +static void cbt_queue_alloc(struct cbt_info *cbt, unsigned long idx) +{ + unsigned long flags; + + set_bit(idx, cbt->missing); + spin_lock_irqsave(&cbt->lock, flags); + if (test_bit(CBT_DEAD, &cbt->flags)) { + spin_unlock_irqrestore(&cbt->lock, flags); + return; + } + cbt->count++; + spin_unlock_irqrestore(&cbt->lock, flags); + + /* The queued work drops the reference, or drop it if already queued */ + if (!kblockd_schedule_work(&cbt->alloc_work)) + cbt_put(cbt); +} + +/* + * Set the bits of [start, start + len) in the present pages, without + * allocating. Return true if a page is missing, its allocation is queued. + */ +static bool cbt_set_present(struct cbt_info *cbt, blkcnt_t start, blkcnt_t len) +{ + blkcnt_t block, end; + unsigned long flags; + bool missing = false; + + end = DIV_ROUND_UP(start + len, 1UL << cbt->block_bits); + block = start >> cbt->block_bits; + if (unlikely(end > cbt->block_max)) { + set_bit(CBT_ERROR, &cbt->flags); + return false; + } + + while (block < end) { + unsigned long idx = block / BITS_PER_PAGE; + unsigned long off = block & (BITS_PER_PAGE - 1); + unsigned long n = min_t(unsigned long, BITS_PER_PAGE - off, + end - block); + struct page *page = CBT_PAGE(cbt, idx); + + if (page) { + local_irq_save(flags); + spin_lock_page(page); + set_bits(page_address(page), off, n, 1); + unlock_page(page); + local_irq_restore(flags); + } else { + cbt_queue_alloc(cbt, idx); + missing = true; + } + block += n; + } + + return missing; +} + +/* + * Account a write again when request based dm starts it: dm suspend waits + * only for started requests, so one accounted at submission before a + * backup point taken under suspend may still reach the disk after it. + * + * Runs under the dispatch rcu_read_lock() (blk_mq_run_dispatch_ops()), so + * it must not sleep: if a bitmap page is missing, its allocation is queued + * and true is returned, for dm to retry the request later. + */ +bool blk_cbt_rq_start(struct request *rq) +{ + struct request_queue *q = rq->q; + struct cbt_info *cbt; + struct bio *bio; + bool retry = false; + + if (likely(list_empty(&q->cbt_list))) + return false; + if (rq_data_dir(rq) == READ || blk_rq_is_passthrough(rq)) + return false; + + rcu_read_lock(); + list_for_each_entry_rcu(cbt, &q->cbt_list, list) { + if (unlikely(test_bit(CBT_ERROR, &cbt->flags))) + continue; + __rq_for_each_bio(bio, rq) { + if (bio->bi_iter.bi_size && + cbt_set_present(cbt, bio->bi_iter.bi_sector << 9, + bio->bi_iter.bi_size)) + retry = true; + } + } + rcu_read_unlock(); + + return retry; +} +EXPORT_SYMBOL_GPL(blk_cbt_rq_start); + static struct cbt_info *do_cbt_alloc(struct request_queue *q, __u8 *name, loff_t size, loff_t blocksize) { @@ -288,8 +456,16 @@ static struct cbt_info *do_cbt_alloc(struct request_queue *q, __u8 *name, goto err_pcpu; memset(cbt->map, 0, NR_PAGES(cbt->block_max) * sizeof(void*)); + + cbt->missing = bitmap_zalloc(NR_PAGES(cbt->block_max), GFP_KERNEL); + if (!cbt->missing) + goto err_map; + INIT_WORK(&cbt->alloc_work, cbt_alloc_work_fn); + cbt->queue = q; return cbt; +err_map: + vfree(cbt->map); err_pcpu: free_percpu(cbt->cache); err_cbt: @@ -671,6 +847,7 @@ static void cbt_release_callback(struct rcu_head *head) free_map(cbt->snp_map, nr_pages); } + bitmap_free(cbt->missing); free_percpu(cbt->cache); kfree(cbt); } diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index 20f495bf5399d..5a8cd59ec257f 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -522,6 +522,9 @@ static blk_status_t dm_mq_queue_rq(struct blk_mq_hw_ctx *hctx, if (ti->type->busy && ti->type->busy(ti)) return BLK_STS_RESOURCE; + if (blk_cbt_rq_start(rq)) + return BLK_STS_RESOURCE; + dm_start_request(md, rq); /* Init tio using md established in .init_request */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1284bb0e4ebc0..d76a0c9be28f0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1627,6 +1627,7 @@ static inline bool blk_crypto_register(struct blk_crypto_profile *profile, extern void blk_cbt_update_size(struct block_device *bdev); extern void blk_cbt_release(struct request_queue *q); extern void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio); +extern bool blk_cbt_rq_start(struct request *rq); extern int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg); #else /* CONFIG_BLK_DEV_CBT */ static inline void blk_cbt_update_size(struct block_device *bdev) @@ -1638,6 +1639,10 @@ static inline void blk_cbt_release(struct request_queue *q) static inline void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio) { } +static inline bool blk_cbt_rq_start(struct request *rq) +{ + return false; +} static inline int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg) { -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel