From patchwork Thu Jun 6 16:12:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13688753 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2115.outbound.protection.outlook.com [40.107.22.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 005631991C5; Thu, 6 Jun 2024 16:12:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.115 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690365; cv=fail; b=WFCbQJniEEYoq4q4VZWDU7BZXKPnz7+BjgSe5ImsUuyY3fZ+RWC6Y3XPJZX+jS/1mpRcoMP5njg7JmuNdunu4U1cxHAPTCUUKAEB6OrWO4COQuCDfg0rnHxo05xu0XCsnFQqd6oHMAIaKMic92O58Ag0f0MBSXuTTIPUXuNAOpE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690365; c=relaxed/simple; bh=hrXyDaUZD5O+KIuY6QI0GBnrWAENZW6x0xDSGwfPjoU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=q8LSN1WJga4iPfZHN9VRyyDNi9RjBGW1H6A4zwzusPVyfqRfNSkQukJod+kRq1gi5TXPyAO+7Uz9/Mc4qxwerBMcvf13qbH5UaeXRW3FZ8ff1Y6ub2rErZA7Att6b+/Sfh7pKwJTFjRrDUiBZLJn2vddGxzhBH+d0z9YjfxQWog= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=guqWz5Sp; arc=fail smtp.client-ip=40.107.22.115 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="guqWz5Sp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HuwTf7whzjLoquvu9+o8QKauz8MH5WV9dH70wB1gIAMbBgO1hjw5kPi3KGXkK1TsPG3p4qYpGcRwDiQ3jCobLRJR1k6TC+qWzjygG0pXcCcvpS3eQEu6QFugEC3DXwsRB0dpbeNpKAWVNVc3o0PrZA+LqOQ5LtUdYOI/JyeL0sNDAl06wp2IYyEdsumKrieG3FU8WlUY4JcqZUWygAcrmLvU9q8RNyfwq80UMvRq8CDkEACtadbGTMzAlZDTajNrORh7JlVzjAfJZfKnN+aKuie5q39GFIK4twujvt9ySgF2TZbKbFedqG1jnWbhOohOYMaO40DyqDqMDhhBB18Qlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=427ibjUET2vgiYD30TKQMjrgcTz1GT6EqH2o5uxTbbg=; b=dLAFRpUlNHUMLrQ1i1dNl0at0kVgaFBLdy+yPnJ0TcIXDAxA+oojD/ZFMrdb1k584/ynG1zlooFGAC2cZ78YWXF8jKvhMyjGz4MvDzPV2Y/gOITd8Xh5s6hfwl7Prpext3yzo4Zd+/dGRIn3TcjtlzBG87bgJdQDmCAGscZO2yiGMcrxGxIalBLn9POI/9YGHWt7SuWHVbEJWdQzmK00kjM+6t+HP04wKTF106DBitAARM3BhZHOzTW2q264WYCPcypRX+0Om0wvVz33LiQs3aQuamAVvElozZmwU1ipufxoLHHW1touWMOrSOtcqDaedDOEGcNECbGLsBCn1io2+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=427ibjUET2vgiYD30TKQMjrgcTz1GT6EqH2o5uxTbbg=; b=guqWz5SpW0uhbmxgZMNSJ8WrbQlOpJEye/vNy1PTu2bRw7Qyc5U46te1G9Qw/AV3MkSGagw/PIEjo1FCOOTWh/43kKpcobyHrxJhk6nBN1ZBfoRYMMtU90ObYquFre8ydCsaUrWhUfyNshimwSzjjeWbjTC6VP1Wx1nDxhOT1bOLagUOijQ/+4hSCpNXkP3GAKPOAcg9eaww7hobczDMkg85hFFdTs4R0s5hX3h6x1WLfcflR8fZk+2mvXm4659lVZMJF13tnm67H3+lP81d89FniWqqKC6+SbflzeQC7MApI2Km5kO6abCkROxCSf6ndOgLypYssLD3rUTi9crCYw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) by AS8PR04MB7815.eurprd04.prod.outlook.com (2603:10a6:20b:28a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Thu, 6 Jun 2024 16:12:42 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%4]) with mapi id 15.20.7633.021; Thu, 6 Jun 2024 16:12:42 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, pabeni@redhat.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com Subject: [PATCH v3 3/4] drbd: use sendpages_ok() instead of sendpage_ok() Date: Thu, 6 Jun 2024 19:12:15 +0300 Message-ID: <20240606161219.2745817-4-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240606161219.2745817-1-ofir.gal@volumez.com> References: <20240606161219.2745817-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0009.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::6) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|AS8PR04MB7815:EE_ X-MS-Office365-Filtering-Correlation-Id: ffa8393e-b4d0-4f63-5a28-08dc86437e65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?VP4zlff6d8P4Q8cffAf1XxI4gn+AytI?= =?utf-8?q?bKf27lPFMmfU7G4lHQMvD7WcFUIQwaCUU5cSWiVFJ1pHasRrw0f0r05zJY+AiNuKt?= =?utf-8?q?jVh17Idl4TCF8DZbdYfhXvL/XH+pQfBTJV7umJIQ/Ta1Gi5YBE6onNXyWuLMHtW70?= =?utf-8?q?vTZXMkmCyTEGuQpSQsd3kjzzOxxBSRzo49IXX/iNZntruxen1jAHufep0dIHu5cWo?= =?utf-8?q?RKc3uiWC2W0ySY+gr85VmFfslKXEQI8sbb5dojretvPgdTHVkNZK7MbzK7V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5utoU8a6216JR5zGaEEL8H5PxA1LTQGofLTHyX8LC7Em8guUI7ak?= =?utf-8?q?JGqV9Kqf3ATPHPkvac9jIQ08UGsqgWGFuREraZDJvUyxsTv/PlnHtAr2iS9auzH34?= =?utf-8?q?rns7qsslv/2/LZINIe93ASlVC+P4AQjYVjDmnX5njNxKxCBDIsAkhdts=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5107.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?r1N16921y8v0x2Xq93g8ErN/yw2P?= =?utf-8?q?sANgaANXWtTpgj+WX/thCVK5Fm32ctx7IfqIHIkDR0u1jSTIIAmIeHx7Yb+uC04Zn?= =?utf-8?q?VioMNRFooEdxWflk7nutrUDDiHp7ntsjPDKJPcyn5YQ2IwvrBEBu+sQLd0+KXXL3/?= =?utf-8?q?TNabFUbQd3i3T/DK4+jcsDPlVljEuaxuBnxiffOgr4HQF3tjA8QPPEFK0v3lSkrfa?= =?utf-8?q?n18lZ24oVmP3s3lqAgRnfAABtPAUqMwvKOxbESzaL/KSiSTxmSvkMjQmyb1U8FET+?= =?utf-8?q?Xh/R/EQDjbZPzWXrmuVTCj4yHvaQbGrTFbrMEX2BG5kt/g2A0mfMrMB9a2Trh4Mca?= =?utf-8?q?uDG2IvkjomeVBVD9gpztYJRRrqYd8yPVlwEZ7HKPsgnfLjm56yRbTDdWH52xIBgx5?= =?utf-8?q?MRzaHPn9LHp4haHdUnEkqc3GXTLmfO8n528c1004lTRaZDQqViEjz3ZycqKcT1aX2?= =?utf-8?q?85A8R3l4IuLZ1SmTXQTNJrRsbiWoVg+NbrDXOhCOmOaYNRKpsnlNQgPCFvLLa615N?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7tVnDbeFAKGvVRm2XICJsC6YZMOk6SfeoSkUXzy3LKK0TUHdvlAAycCS9mPwz?= =?utf-8?q?rEiBNmG1hCHzJwfR+G6wsyd78BRbzOCZwKCwafcZgbB/kc5uxdA5/Q/f0qjRS2/i1?= =?utf-8?q?sesVXJaZRlKR?= X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffa8393e-b4d0-4f63-5a28-08dc86437e65 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 16:12:42.1807 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8/nynYWVLoUjrKCZcZ7u3RHje+ZSei8NpzfFLlsaajGhOYnEDZlNBFFl1UW7QbMkotqeJSsowmEHjQhAHGAV+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7815 Currently _drbd_send_page() use sendpage_ok() in order to enable MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator may represent contiguous pages. MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the pages it sends with sendpage_ok(). When _drbd_send_page() sends an iterator that the first page is sendable, but one of the other pages isn't skb_splice_from_iter() warns and aborts the data transfer. Using the new helper sendpages_ok() in order to enable MSG_SPLICE_PAGES solves the issue. Acked-by: Christoph Böhmwalder Signed-off-by: Ofir Gal --- drivers/block/drbd/drbd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 113b441d4d36..a5dbbf6cce23 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1550,7 +1550,7 @@ static int _drbd_send_page(struct drbd_peer_device *peer_device, struct page *pa * put_page(); and would cause either a VM_BUG directly, or * __page_cache_release a page that would actually still be referenced * by someone, leading to some obscure delayed Oops somewhere else. */ - if (!drbd_disable_sendpage && sendpage_ok(page)) + if (!drbd_disable_sendpage && sendpages_ok(page, len, offset)) msg.msg_flags |= MSG_NOSIGNAL | MSG_SPLICE_PAGES; drbd_update_congested(peer_device->connection);