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 2D6D580474 for ; Tue, 27 Oct 2026 11:49:26 +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 69RBmB30027540; Tue, 27 Oct 2026 14:48:12 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RBmB30027540 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="ZdTuC/G7" Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69RBlu9G027499 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 27 Oct 2026 14:47:57 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RBlu9G027499 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-9196b477c4cso22321436d6.0 for ; Tue, 27 Oct 2026 04:47:57 -0700 (PDT) X-Gm-Message-State: AFq9FYKC2S5kdp+xFJGKnozX5sU7d774FyJXezaN3kcmBpvGHSqR+KU6 HkL2asj+qFGsDKrcekaiXqGWEF4r24/XTCW1MYuwjcfkJR6lRvTW+mzXXwdPahbNrfDPAphzjxN dBc92EQP0UvOdgG1CWFfFbQCGzdZRB3Im5P8jyW42i79dHRMPZtdRDA== X-Gm-Gg: AYBFou3cZUzAcWChgiwxxk33B91kFxSAhOX3CBYHuDCMYu8XRwriGYKbip2sm4MP0Xn Ns1YWuIEZR2cWWAWIuOTn9tOrDBg++rYLbIEeqwFKAFl0pW5f0v4yuAbwMnWj0jkkRkv731R31c I3yzlzc0EkIyyQ/UOhs2Ahd9itjupxUr5HtkhbBW0SxGTwKzE/lG40DaoqPYIbXJCEv9NfGtNEc BtSMYvUAQBanyON0n9/wv6S49f/tP5vdYhX3BwXaeRfcqPDMnR8LMqHmuqhG5t+WXlg+Zijbvbs b1XhO6SZVy9gHIWlND6yoSKlitP4E1CVpT9LSAWeR+1sBnNuQpj2CaA1w9NrUY5bvgbaiTf7JgO nGChk/tO8QQR/+CIcwEygga6R/p4w8a7+Xf4ngmoodaA20O8wBaC/brASREm9s46pC3grXALZs3 M/8oIK/Lk39UgqGAkBuQxYchxdtyrD X-Received: by 2002:a05:6214:2262:b0:91b:9582:d91e with SMTP id 6a1803df08f44-91c6d26051dmr44429326d6.9.1793101675966; Tue, 27 Oct 2026 04:47:55 -0700 (PDT) X-Received: by 2002:a05:6214:2262:b0:91b:9582:d91e with SMTP id 6a1803df08f44-91c6d26051dmr44428906d6.9.1793101675351; Tue, 27 Oct 2026 04:47:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1793101675; cv=pass; d=google.com; s=arc-20260327; b=VXYrqFKyncPXw7L3ggdNBmJmVhf5sM6Hho86TmnZs9BDFGfK8fRyAJln8SK0fwomrk QCLeShRF2DK1asEPHAI4YgIYEhF5tESM8aMTrqFUtfn4r3Dp5drX7xZJAyo3x1yKB/zd I559TdDmdz6A7lwA/Rm8nVKSAilFYrU2pAM8PGPLTY3n432/lIM6Ws+YTrYLMRpnsYLG wBFF7z/YtOzyyxLKSImWt2fcyJGHXOgO0/PDXXHiV5l4L8pNnK8n+/T2oyyNBYh/ucbd MkHvTVxcziiNwHHdxiDw0M2F65GDXSAEvrxW5ThRs3pnSZKU2KhiS5VSM9b9JOMtmHpl ZVXw== 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=LolSKSVVCDxZiyXD7baA47j8rNkCtLpLmNXcEsDKqWQ=; fh=y3TfVeQA9QYtIzD5Inxiyys5ebBfyOgjQPZaP/+mSiI=; b=XRhr6wqUn8Vxsr7CWqP0L6YuQU64+XUawRx4fzBZMs9dywwaql8tOUvLNT3djLEHY7 WmTJ5D/cWlKNSv+ewFlJGYa9LSJzEBgnCdRRoV1kaBBSxVR2FQNqPATch7nXjHG51adH 0Ri1VvdA/kK9G3WFkokubw+BBb1VkAGjHDtpN1UUIaNTicq5KALACMhBNd3viFb8qLNT BSoiLeXoEwl4QuVoFmHbdtQa+d07wOQ1K5XnKZLlM8jrpG/8IYrLYwaAtbOZdBCtcGKg N96Ghf2PTEFV9o0SsC9mndUsL3fhJAp3Ticey2TWyZHjVdT6I+lyvz6CEV1DHyjcXffS lkzw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b="ZdTuC/G7"; 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:c202::7 as permitted sender) smtp.mailfrom=ptikhomirov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from GVXPR05CU001.outbound.protection.outlook.com (mail-swedencentralazlp170130007.outbound.protection.outlook.com. [2a01:111:f403:c202::7]) by mx.google.com with ESMTPS id 6a1803df08f44-91c6e35bf4bsi25949786d6.128.2026.10.27.04.47.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2026 04:47:55 -0700 (PDT) Received-SPF: pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c202::7 as permitted sender) client-ip=2a01:111:f403:c202::7; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b="ZdTuC/G7"; 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:c202::7 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=vmZT2aqRkxc/UwAb4g4/0fJUBiY4unWF5pVer9uCJhmigiQWhq/lWvGaVTnfWM8KIP/qOgOqE5M+dHe5Jn2slki5iX2Sdaz/x5cY2UKmwd5U6AAA0Lb1wWEIx9PYxUayILulgcnec5LzgAxnx9CeIqZxtcxj1EKnUjVVAMq+sLdUumFjIAAprWzq3LBJ2AeOdQnn+ig996voxcFIH2Kw9WmINBw7+RV0NkKOeFSoJQKsxoo3O6GyUyW8+/EaSZdNUqMXihf1qfNBD+NLK3lOg78vYpWxeo5p+k/VrSJas8EqLE/9gDfj3PGYqyvHHE7zX+1H4TYq7xkVIT/YPGA5Gg== 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=LolSKSVVCDxZiyXD7baA47j8rNkCtLpLmNXcEsDKqWQ=; b=jB+BAJf9dPLwWUNouZKuWnXFOfddmf3bdl2102Pdz5G3/Fq8JrtMq9Ywqxj95PNT8F9x3gmUUxM9gbzqxtBFA3RuSp6V/KvmZxCF0qbgp7To+EGIvCyO/YdICB9tS/yLjVz/ImF+NyexHP5/F3X8k5DNvBk11jhdg3bnU9qFOsHe0rKMD8oAILFlibqEMfe5SKNryAJdXwnHQxoO10TSaxBHzG/4NQ/0m1f1nPP9NmrpxpibLaSjUGppnFJxYFbW/yTkUOuZiMUppyE4xTP9CCltcJ8RGQX9d0vxjJitU9T/8R9JIrgjbYoxbfX0KM36iBgLjhFO6Pj2Dseh2sP7kg== 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=LolSKSVVCDxZiyXD7baA47j8rNkCtLpLmNXcEsDKqWQ=; b=ZdTuC/G7edE2gO5jVp0UKYE0IrnRVJ8bjl1ROC1uVUzkzgK45r1gB3YJvmju/xzXtSw6pM3xqnXBmfVLmzDvAoqki3WmblL7MP3vLOWUlYCYMmq9b4slQ2mPlwgfFvUt+1pFE5LHq8PAwPwpUqZtdJC2MeOGq2tx/sD/BHDECYjLDURDlyKXPf6z8fWE1qm7c1mLxKyZRRxoXv3lwACR4+e3eURDh5h5N5lqVPiITZRxIy0zpv/yo8TebHu/A4edal/G4M7Bne3jzrV3TC95I4w2442vDtjUgVJU3CyFYcU89IXVgfLlMy92IiX4LGTy52jrsWzwVz6FHgSOw6Twpg== 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 GVXPR08MB11536.eurprd08.prod.outlook.com (2603:10a6:150:2c3::17) 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 11:47:50 +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 11:47:50 +0000 From: Pavel Tikhomirov Date: Tue, 27 Oct 2026 12:47:42 +0100 Message-Id: <20261027-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v4-3-b4d92264f6a4@virtuozzo.com> References: <20261027-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v4-0-b4d92264f6a4@virtuozzo.com> In-Reply-To: <20261027-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v4-0-b4d92264f6a4@virtuozzo.com> To: Konstantin Khorenko X-Mailer: b4 0.16.0 X-ClientProxiedBy: BE0P281CA0019.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:14::6) To AM0PR08MB11804.eurprd08.prod.outlook.com (2603:10a6:20b:747::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR08MB11804:EE_|GVXPR08MB11536:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e1f8ab9-d4a6-42f8-ae96-08df342020fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|23010399003|376014|10070799003|52116014|261022075727099003|261026140227099003|56012099006|261009223027099003|261022105027099003|261021121427099003|10067099003|261026121527099003|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: ppzVU0W8/v+l+Q+3hRON7/d2DppZnv7H0LJvIOLvzsrSHVTrJ0qmAxMEyliJyROzO7l/tSBP22YQniJ+9k0oAy54ZG856RftdZeJc6o7uiE9k46h9TZidxe5963xJkOERf7gsdYwZubHpT5aNDFo+RVPk7hNR8oOj+D/3sSAd67ZBAzO9rgACo9apPJcJfR4vMGJFTw5+IhuVYiggODybvhDfzodt55PuAZaFBFTjapkM8AphCcfa/zSmrlvpfNKWG4BV3eEHHvJ4U4CStQN8D1WlK+e5DG7ZaFV+p/WySFzip0YRWf5t1XEdACWxd5L08N/Ynnly1FSTD5pfU5dT+fVEAzPirWK7FIgipHpdf/XhxyaJlK7jEkq3yJNiwx7RH2p7ntL4Do3ngj06svzNOrm8R5cd1YR1DnWBmIdegzrY0V2bdpYYbYwpjfRejvpERHS7BY9KFPO1WuaMAcAD1m2yy4tHfcRo/l10+k3nrmo7UkmdOlcbs//ihfibyW1Tw+XYAhsKfgp11+Rj3LNIUPRWvvApxytZK3lU/0sWndpH52Lh12YeLaAZgwANa5Z0xWTShGE+3IEKEEwBVyK24Epa82omHJURrOJia54lsOXnPYUvUtU4rYbqJxalGC0 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)(366016)(23010399003)(376014)(10070799003)(52116014)(261022075727099003)(261026140227099003)(56012099006)(261009223027099003)(261022105027099003)(261021121427099003)(10067099003)(261026121527099003)(18002099003)(22082099003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RUUycEI4MGN4M1V0K2VOMGxxMkhya3EvKzMrL2tRdEQvVk15dTRWTGVHdCtC?= =?utf-8?B?SGhIdFhkRHY1bGdXRllOWHA2aG0xTWVqMVZlcThRdzFhZ2F4U3JGUkdLVE9G?= =?utf-8?B?VzAzUHl0UEpKcHl3OWZmTGttUHhIbFNpYUdJSndGVHI4d3pKMlNTZGR1OXAw?= =?utf-8?B?TngzMWV5Y1lNRHNkTU5ka1Zxd0ZOMzdTSXBQUzgzclkrTlJ5ZkRzL21XeW13?= =?utf-8?B?RXdyYzY3NVhsY0FsUW1hRE5iSGMvNmptWVdUUm1hOFNBR1ZnT04rd3VWZkFo?= =?utf-8?B?b2RDWk1qb1M3OUVTY2w4OFBYbGkyc3c2RkUwSnV1N3VMZUVjWmpmaFErN0hK?= =?utf-8?B?dDZpYWtNR0J1MjNzL3NHbURFdVNYc2hBSUdWVmJwVzFMTlFUdE12bUs5REVn?= =?utf-8?B?R1NmbWJQUEo1OTVkalpwKzJ6YVFQM0lEN1NjUGNSU0ptT1o3R0svY3hzTEF2?= =?utf-8?B?SGZrSTh5dE9CSEFZ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SGNl?= =?utf-8?B?R0dIQ1d2ZXA3bnp4ZlUwRUQwdGM5Mm4xRHdTbkk2akx5N1BoZTZxZnV2aHJC?= =?utf-8?Q?o2EO7CE3qmA5F+PYUcy5/UYENeIk841xGqTyUVGQLhwl/?= X-MS-Exchange-AntiSpam-MessageData-1: ZsiFxfSYPJqcIMh/vEIaJ2xNkbqRlYrNqbM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e1f8ab9-d4a6-42f8-ae96-08df342020fa X-MS-Exchange-CrossTenant-AuthSource: AM0PR08MB11804.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2026 11:47:50.7879 (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: ytH9OaDeWDSFvGCyhWZut4i5Phu1czEja7m18w3+V1Xxz26FlQ2CWJ218QKPsjV19lwFEDpoaHfbTp6uAIwMmh1Sl6pjAYWoHEdNmm5xwfk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB11536 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v4 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, and the allocation of missing pages is now queued to the kblockd workqueue already at submission. If a page is still missing when dm starts the request (the work did not run yet, or the write was submitted before BLKCBTSTART), dm returns BLK_STS_RESOURCE, so that blk-mq dispatches the request again later. https://virtuozzo.atlassian.net/browse/VSTOR-149268 Feature: cbt: changed block tracking (for backup) Signed-off-by: Pavel Tikhomirov --- block/blk-cbt.c | 170 +++++++++++++++++++++++++++++++++++++++++++++++++ drivers/md/dm-rq.c | 3 + include/linux/blkdev.h | 5 ++ 3 files changed, 178 insertions(+) diff --git a/block/blk-cbt.c b/block/blk-cbt.c index 1066b6a33b6b5..ae941ec7e7a1d 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 to allocate, see cbt_alloc_work_fn() */ + unsigned long *missing; + struct work_struct alloc_work; + spinlock_t lock; struct list_head list; }; @@ -221,6 +226,82 @@ static int __blk_cbt_set(struct cbt_info *cbt, blkcnt_t block, return (pages_missed && *pages_missed) ? -EAGAIN : 0; } +/* 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 queued in cbt->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); +} + +/* Queue the allocation of the missing map pages for [block, block + count) */ +static void cbt_queue_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++) + if (!CBT_PAGE(cbt, idx)) + cbt_queue_alloc(cbt, idx); +} + static void blk_cbt_add(struct cbt_info *cbt, blkcnt_t start, blkcnt_t len) { struct cbt_extent *ex; @@ -236,6 +317,8 @@ 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; } + /* Queue the allocation early, so blk_cbt_rq_start() finds the pages */ + cbt_queue_alloc_pages(cbt, start, len); ex = get_cpu_ptr(cbt->cache); if (ex->start + ex->len == start) { ex->len += len; @@ -266,6 +349,84 @@ void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio) rcu_read_unlock(); } +/* + * 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 +449,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 +840,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