From patchwork Tue Jun 11 06:36:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13693155 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2113.outbound.protection.outlook.com [40.107.247.113]) (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 6961B17277F; Tue, 11 Jun 2024 06:36:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.113 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087801; cv=fail; b=uJ5BpeKTKDxTRSWxhvtx4RpnE4GjbyMaFZl0CKfj1NuO7/oLDPreV3NFEn2TroSeWaZ3NmZ0/xIIgVTvi3SDXjgB5Vd4vGbqOLW2aHvOHcVdHYtgNH35gYKJJXLQ7hiFTdnSIYXhbbFQsZhEurP7hHD6fUHus2X06jWJyMA6LEs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087801; c=relaxed/simple; bh=hrXyDaUZD5O+KIuY6QI0GBnrWAENZW6x0xDSGwfPjoU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=RhVoz7FDQE76tc1rN6e1bgarJT/z412Hr9niHlQgq6AENlmyqcWOnd3jLwvRM7MNCCfBuxCpaE8bmnFWQ8hYcR04yx4VeXwHXQMp+GaLT6bpnSkKSHz+d2F6+KFopcBfD45RIcEYsShD+hwJ/t4POnTODzhJDNB3o1x38zDVcQs= 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=ImVExr43; arc=fail smtp.client-ip=40.107.247.113 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="ImVExr43" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UcNM7otcTBlKBxAdidLgA1vqNV6pDlPZE0NtpZNci+I0GjSb47b2ugbdbPMOCHX7W1jUMB7KJvL8pGZti4oRGlgWvlTdGevABkr2FDnueA0uPM5caJPJ0EIDntgH/fbzZsAVptr/HIPqzB2xEj0oRd8Ada6ww3OwgPJBlTbegEws9OXvtP3qQdXsHAwkeG1QjHpFw9j+LrXfkZPVnFJ2iXp+uSrvgGo7qd1ZYaybrSaKZ6s2ZIOBnkALvU76wAXltzjrr8K/2cR3LMksRjY4kzNkIL5ekdNlb3pSogImC+9JtRINsjtZJu4uTTgdr2rMLT1H5atgygt39nNyjMWgfg== 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=VVutqMSI2D6d+ExjzqK5j187yA7ODtsw1FunRF8U7467Snjf1CH3GaaXyvb0mf5szgoDZj6t9TUBzEH+uqGjX/sfNwjsnDsb4kZOC11gYmwqWc+j5hwzrfGoTJKxnUD/gKWwO8DPr/yZolx+w2efsmHGVqvs4Pq5rptt49fR/uOQa3kJEZXe2J8taL4DT2I0NO3d/Te++7UOuvZdHlbldS0ZoYjvoNHIvrbBs4Ep7sWFvJFqaeboY/7WLFSgiXjLfjI7Ntg0Hi0f5H06CZvnQxH+1P7f35prZ2dRNG24WJcK7QFhNGMU3lNEsYfGDwD9fXEf77X5INUcZIURv/o8Ug== 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=ImVExr430azNG615NNqknS59S5uJwPIl1q3c49TGFZ2vknbpdXt8S1lJoylZMr7viMCTy46M14N5isbSzbe5B5mRTArwwOr0aflxEdbLDeVOwXNIakApgR5uPh8QCbjkHFghI2esSRnaG8FbARlJnEDlcnADGTUjyFTpx1ISKDb4Mz/etPI6D+DPRcbYHHnexXsQJch7BxtEL6A8QSDsRzIzl5I7Ai1Hvg+bjA72VLNSxDf8wwut5xhBdtH4xp2I3dDkMzpDRey01C760U4APNgCsWDnmSIy3vfn+pDI8Yd/Gt/9bWEBhi9WFaYdVuJnx2bxRkwxtRnyZgYi+T+KDw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) by VI1PR04MB9977.eurprd04.prod.outlook.com (2603:10a6:800:1d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 06:36:32 +0000 Received: from AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371]) by AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371%6]) with mapi id 15.20.7633.036; Tue, 11 Jun 2024 06:36:32 +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 v4 3/4] drbd: use sendpages_ok() instead of sendpage_ok() Date: Tue, 11 Jun 2024 09:36:16 +0300 Message-ID: <20240611063618.106485-4-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240611063618.106485-1-ofir.gal@volumez.com> References: <20240611063618.106485-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) 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: AM6PR04MB5110:EE_|VI1PR04MB9977:EE_ X-MS-Office365-Filtering-Correlation-Id: 39d04b5f-1bdc-45ed-ee84-08dc89e0d52a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|1800799015|7416005|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?65YQhIRK7URILPbqvCpkkSXh4Y4tIXB?= =?utf-8?q?ODhGxJBjEojE2SCnA7oomjUXv+h75ptNsSQa7qIPpcvt01APHQkYMY4MOmB17zj1B?= =?utf-8?q?Ip2WXETvy++od+8MvhkXE4upkcYQl4xoLwTDxFAaBhj12y8GdUDzrJAqSvRxNyUnk?= =?utf-8?q?HNwKomIsOr1TUhAOW6g+Ii1PyH8VS8vVzcfybt3gtLiha9X4XvQQNIRH2gfUQZaXc?= =?utf-8?q?gHK40lLh90vpRNzagpN6PbUQ9nTN9Cm1Xl2Bsbcbtzl2jFU1eAs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q?Mv87rUl+mPpZRqwoLaAbuwrzxcSeBSDmJGQ0OpOd/TM0dQsLAMRxcT5sYAtKNDZuX?= =?utf-8?q?WyR4RejhsKWlja6jVmqEOSJc3W0Ce+HBdqUjBRIaiqflCixiMY7BhvL79sNlK5ihi?= =?utf-8?q?ffB5LjPDwTSUBEiXrRex93UpjyE1xAYzQZa5oBjlXSNDP/mbwfIILzdg=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB5110.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(1800799015)(7416005)(376005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?r+3xCVX6EWJCtyzsK8jWuTA4gVs/?= =?utf-8?q?FuLMXZPxyxQ+ZyT8RsyykgpxaV7Ph+mu0dAbWOUj8j/upt5zjXVsqkdFdJLwv8ZNg?= =?utf-8?q?FNUvCRO0lUxB1QqsBsJD9SgUJZUiC+z68tobh+Pen+o0r7oQ7Tvdoyz3uVAxGWEwq?= =?utf-8?q?XHHjlOMhbWYJHz8rMNLvT0pu8NX9jx9+iMhmRXZCQ/JMsxC+LXgONA6utmt6oT3f9?= =?utf-8?q?suoHlNZueOtlPxVMfdNfIDoEQOV5N1B+ni424MCdf5eyX6jIsBnOwIAWJKbZK6nZJ?= =?utf-8?q?skW/X5Of9KCo5rA2LypzuWfVQY0YkhWGlydTjAE9xwqVi93z4Zwq2CgSL2pPjr9Mb?= =?utf-8?q?dbQVphODpAI3PF2NHJnh8X+4zLXhtXmdh+FrXIY58Ja6q/8HXyjhEuWYmSPKsqCgC?= =?utf-8?q?zDMZbrCS2GVZyhLEv0X/MMMlFmakrU1JuDXAkmjPnqjmPwy9AQzEKszcoHbxUVi2M?= =?utf-8?q?VNfb28wee0fLk6fi6SATHVRNui9bim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inn+Ahmqi5utqyF1FuiN/wU4uRSe0ew4EWSedHXNlClr?= =?utf-8?q?JhuZosjLNAjhje36bdtxIlKz4YU47LlbagcGb84I1D5ZckiDNkxopYCXnOdU9LKBW?= =?utf-8?q?S8+Nqk3M62LD36VF/A3G7fpB1O50zyF799k0WevaL+JNZaTjuBTlztwsoq236Qoqj?= =?utf-8?q?boIwveRAnyNn?= X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39d04b5f-1bdc-45ed-ee84-08dc89e0d52a X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5110.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 06:36:32.3194 (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: /YpgsXZuFOPpQh/WzxeeAknxlL1D9RUqP672z+Akxu6Y0ZmrC7FmC29HKf+Per/OyEFmTyJyD/ymxAAwYDmMig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9977 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);