From patchwork Thu May 30 14:24:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13680474 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2139.outbound.protection.outlook.com [40.107.6.139]) (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 163D717C21C; Thu, 30 May 2024 14:24:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.139 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717079077; cv=fail; b=FX0MJV7eWLnsz5hiRrfhzEmCNs+we8e0YO9/hZKOF38eJeFSOQeq/jTNE3kTCyHxmtjigrVpV9i4Lrv+Sb/pJjd8pbcGi/Whhb3+2IIiaGaVANCsqyh5R2329Ksc/b7GX8ChHOkbFqyiwUXbiqkYcNWE4cbGqq566GemVr/UScU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717079077; c=relaxed/simple; bh=QSGoCRYFgQrJg6IAMM2bbx8tqw5acj3fKG9auEmVDHE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=e/ZzwWq/LGuo6XNK4WYlUdKqBgk8Gq98XOlYxBVIa1MTlA784bbU/A0eBpmsPJtID0oudMoaXvP3plUBX+c6AXjtrxv+eJnIlzmJF0gxUrTx+o+0vvFq8EuDbr5jk1S03fy/vWNUL5nibe5zbEHYk62nqdhaU2vtCG2jG4c/K8I= 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=X6FSPPF6; arc=fail smtp.client-ip=40.107.6.139 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="X6FSPPF6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dUNf5wwyF+tnqX5Dc3VyHuzFEGD5T40bcEGioVljmmf8HJGZvDCUUq2iNCdfr0C3g+UKJV+OwkJR+ywcixuIf4eNwH2uMOTKr+HBcjfTkXZ7aEs2fQbCY1Ex/tXwWz7S84a/46lm2BLrv1fwxY9wp37652QZR2ld4R4pcRyl7OIC54rD5Zy8OOaSiAsZMtnRZWnKkjYupl0ntpWN2IDVQGGbeeXCt4UJSok2cTreJa7SV4Lv8OuipRtwgWJEnfKA3stmjnvw8VDAmOIVcY/nsgchmEQfDst0w9CZcEqpiyWt+mJ21m5X+8Km+iVJ5glGap9GXIdzh55vsP9MorevQg== 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=hVkNhCbaBeqVcXtN8qAwX3C9rNtmax2JJ1CKS4eYr7E=; b=EfWAn+EPlSOLENp+lQmREVlAk5x1pvKMd6uFE3QCYHoh0v1vBn65WVcXvi14VCDQ2bqvdVzfxPtdioSlz3Q/ET4NiijoNzaR3n04FcgjMc1ssUmwYZL5bJIB2qS1jlleBBgal/akgN43wO8r2Zps3xAhlGE7Wc3o7ek6qYWW9rFayIvA+u6PELEaFHFQIqnxPYd0qzRlrf7Xgy0S96Yg00xvX7EyK22GCBBjMfp3yMFsotDTCWcNDxzaaPiT/GFlapqAosNzINF+bwhR7+tw3K2Ymqj5ZdxJMYB4FC7EalaPZpJiTBZE3WCqk2gKzdJv4PwWEcpJ7jd1IwlOZuh1qA== 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=hVkNhCbaBeqVcXtN8qAwX3C9rNtmax2JJ1CKS4eYr7E=; b=X6FSPPF6FaIhpAUTCN2GfuPX/o8/604sdePVqQcs7zorx2yrAQFii1ZOGnMpS1YV3PPJOBLinkorojtsw4bougmvdJzgtvQxA5KAuOKG2uYpKY6nR84rtBFa2KJ6+97QilwMoiujWOLd/XtI2tTeEZvYLLUeZt6FG0UJaxVodKAeCNx49+CUm7r8jkMEpsmA5vVJrq5YKxVmKimPv7AP6wlWHicgQSXpJ+2fpgTzWVr+suIOmbFVkhAEzLxnjBjDBU4FlUck4vfx5gENOttXi6TQPwoyaVPI+Hgo7oKXaXLrwePTQFIBG9GsTT6F9g//xQr8LX1z1EQMUKc5NYHpog== 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 GV1PR04MB9216.eurprd04.prod.outlook.com (2603:10a6:150:2b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May 2024 14:24:33 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 14:24:31 +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, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, idryomov@gmail.com, xiubli@redhat.com Subject: [PATCH v2 1/4] net: introduce helper sendpages_ok() Date: Thu, 30 May 2024 17:24:11 +0300 Message-ID: <20240530142417.146696-2-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530142417.146696-1-ofir.gal@volumez.com> References: <20240530142417.146696-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0001.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|GV1PR04MB9216:EE_ X-MS-Office365-Filtering-Correlation-Id: 8fa06474-63b1-4ac3-aaa2-08dc80b438ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: bylxCnkko2p23ia9I179XbjIsOyxMPYM6cgH9MuuJmofELKRgEx3T1jfmxCdnh/LZbDl9lQDUimIaplX5t5Ck/M1eivWCvffjJYG+u0w0BN5hqEeVpfPMbjcIEXJApLwtBG5B0zuSRZ1eKpjxio8HSEW1TwOsF8zG3vVSSCCBv+02AhdquD+Ja/BBDVBH4irfdo80K1dmDQ/VgsMtn9D0S4Eu4fZa6LOz0mF4Bcj6gRt+ijEjh8mPdTd5C4eMwk4XlBCG7Wr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bX1wLaRl9DfFNq1uRqcEb4jxaYxTSCA== 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)(376005)(7416005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oLNDsvmOdfLNXti1qQG5ZNtRnfQpbF+5HvgK2ON/LlJkQAR4qgq1LAv18WpY3ojwTlEmmfmOPPHEtBLO5Va+qbuqNjTYNXz/AkiJHh3o/bBYlIJo5L582lUABRwrHZjVqxpfzXM+rbNuPf3wvR90zB72kw+81qwChowVV/Dcb9Rsh+iMYHi6U8m+4F6GUy5vEYvd+JITZWqra0UstVdBA9YFd+FZs+K+IcxkSdan0mcybG3VOcMurv0hBCdmS03kLiSQp0L8SkRdFdDa/BwKaBbSvTBTvjdOkqNnL2eLhdSVJe6sdTKjugfDIreFsfSMryv2IUHuBHBXys+VurURKyYjPDBm79wuz+avfNHdqHluUlXyAvhdEmusnho5yf1GCLeSAMPJ1U2jWuEhP9vIKyRsHj+O1iyBY00LWGvm7d6D0ohDkiCSMo9Rho+BS2lyoWm/dDYYhktT6qky3o0/x2caVJYcfX2/53YN1123GBvzn9GwDSIhrsv0ha9Z1oZ8bgnUwg4xPPUnaoIon0qj984aOeWtgnC45Od4lY43W56UUlNojigH/vDb0u44l+XwWH4HSgFrMyA6c7Krl/CkhzI+MCgHRvfYSCKZY1UsshA0pJPZJIx/U6IfBJia6BomRRsGhpEsZCD1HsqMiPFlDmIWTWSAlMi79G2cJpZVnEfM2HoWNhoGXp0KGRz7njYBuiDdNllGWeHIH+7laHFwbaM468HibSSPsqQs7+7vQBOOT6SGe+z3rP3zZGixJOLeEj0uVi6Phoc1jXmwtcqoKikGq/7ggDdwSogc6jK7IBD7G9oYr7Du0EP5ZJ448ypQuxF4xFjn8v1USi+io5SJqb9HeVi/xMYWdVwKIrIjMWE4cyOGcvtGj9ds/UJKN1eY3jnYXbSogV1HFJ6cuGKreAtHCg5loJUh2mIX9duxpJluy0fLSyU1tIUe0+SoNxnlgbK96Ur9EioC+4JAf+pd2Alj9rHi4IKLuSQNYzzgHCzgwtSTAXdxjoeV7fOpP2DcxDBHDq+WZD+BU8EBGt4IHcWnQZMdur6YwjDBPxgdmJDmUlfWodKrxauIno5za5NvO73ynVhj04+bK1CsEmHxvv1Ax0vySFykMeYRPf2VZK8Tvklt4zopBh/nqujfi8HT85ch9R/Z9hhb6P0YbEts7wfEvFYRJ+EH0V7qGDOeakAUOw4rm8OsPXVT1haL7BrA4nWYZlsyunK02PbI9D2MdqFOtlopbZhBN8u5+QrUeiuYBovTH4CkXpJJ9GwmtJ/dCmRpP4uOnKN0KnksK8dxG0NUWAJGI6+OMZFQk/RsF62+1OllIQwlVeFVa19Noy2ZL7rDdv2exUcoLYckX5dYQj5OkJnHZ4fh7B4gUycjX2yWFGgHZtXsTrpEDU++r+i/c3wPBIrP0paqiztSrJYfsvp5qZrZU7HtKaLzB+fx8AW4cgB2w3e+3jYKhtkdtTaY1z3fsvB3ahc6yeIZDJjEvjxgBarjdeZW6TE3zy6XY1XJ5PWBDfrDVnlbCJ5Ns36Rrugr2VPJNRBu/ULxCfizitfiLZxI60l2xHKPYxHJadAnSzE7aL5IpuRuZCddBRgV X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8fa06474-63b1-4ac3-aaa2-08dc80b438ce X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 14:24:31.5922 (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: bl3T4IpVRnt7oc3k6w3cq0qsPVnELBEi7rPiNprGV5K9r+mnCOMdXrjRy9v7/K1ZQYpCku+mW7rbf8H3DtIQUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9216 Network drivers are using sendpage_ok() to check the first page of an iterator in order to disable MSG_SPLICE_PAGES. The iterator can represent list of contiguous pages. When MSG_SPLICE_PAGES is enabled skb_splice_from_iter() is being used, it requires all pages in the iterator to be sendable. Therefore it needs to check that each page is sendable. The patch introduces a helper sendpages_ok(), it returns true if all the contiguous pages are sendable. Drivers who want to send contiguous pages with MSG_SPLICE_PAGES may use this helper to check whether the page list is OK. If the helper does not return true, the driver should remove MSG_SPLICE_PAGES flag. Signed-off-by: Ofir Gal Reviewed-by: Christoph Hellwig --- include/linux/net.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/linux/net.h b/include/linux/net.h index 688320b79fcc..b33bdc3e2031 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -322,6 +322,26 @@ static inline bool sendpage_ok(struct page *page) return !PageSlab(page) && page_count(page) >= 1; } +/* + * Check sendpage_ok on contiguous pages. + */ +static inline bool sendpages_ok(struct page *page, size_t len, size_t offset) +{ + unsigned int pagecount; + size_t page_offset; + int k; + + page = page + offset / PAGE_SIZE; + page_offset = offset % PAGE_SIZE; + pagecount = DIV_ROUND_UP(len + page_offset, PAGE_SIZE); + + for (k = 0; k < pagecount; k++) + if (!sendpage_ok(page + k)) + return false; + + return true; +} + int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec, size_t num, size_t len); int kernel_sendmsg_locked(struct sock *sk, struct msghdr *msg, From patchwork Thu May 30 14:24:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13680475 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2139.outbound.protection.outlook.com [40.107.6.139]) (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 DD0A317D89C; Thu, 30 May 2024 14:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.139 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717079080; cv=fail; b=m4kLR3oMKoIu8nfm6Bw96sVNRXTWierXhEdg2bPFU6o08npFVedvHCkYlw1NWCMLVKdXJbsj6Krg12CYcFYIUrL8jZwQ8NM22IVB8XRS2BDa88Hs7JUgmuk3iH/LFNn9TqLsxQtwQcDjdqHGaJE9HNjcUmLmtkS6OmxCSieswWo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717079080; c=relaxed/simple; bh=YJD+FPKgbmJBQczz7F0n2W7TR14NqRIo6Xol2gzLjeo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=ttaopnzDuG7Ls1Y+8ynlIEzvPiKgMbFeKaO5zgjoXSqwcAOF3mHCbz+bH4424qvLAT6twnQidcDItlZ5qYPUiaMguptgHQwTjlyKxyWOAP+QlWteJ7hLbhDlq6uB/7Kq3pcgVtf9yRsm1Tuq+LlwOT/FJv8F8EB4sa1nS28wRFM= 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=PKyhePit; arc=fail smtp.client-ip=40.107.6.139 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="PKyhePit" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mgvXXIz149Vytge/iL6oWjD6vkmG3wOeo1MHCSXqndYHq88uLvC3IlDxbLZzh+zyR8/kbiUeO2PcUkQKEV2fTe7hFEoyBZ4V2hKUMMKTuKVZ4QSVwovZG8RT48o6a+kMW8T7/s5Uz4M+tMK94xNrXkDREvcAXZOFVQzahEv/c7yin9+lEGDqxshLTEyE5ymZMLbNtM/HNYLbwZn1E8p9Ebq+106GCYNZFjAt+Jrvni4xtqRLrl6VJ+eRJROsyB0CIkqaBJQpSQPY/RqDIL852dsntYQBvnlXTTBMi47auPjnBqs8U99I6HMwylN5Fai2C9dxeq2g2N8qggBsDqawjw== 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=u6CD2Ca2T75xtBaR82rnXRMIKFDHu6ZHcG7APYtvi+I=; b=GzsOcyaw4xWcw7aoXnff4xJ832munv6w0lC4E8MgYRCQve1DwXPpoqC478KAsRuYqX2EoPonbGGV+R6+y5dhotc75Y/0Z9/4Q8ekU3/vgM9HwXkod+JHqPXuanDAzsg9Wp2Prfyx3Z3BwyyvME5F6JzXYD5gSJRIRWcEk2+0wN5kW3bD9aGXvLvg52hkjDXbppbrMCNUTPHU8lQ0lMrqruBYAQGFQjsrxgjI1KdH3gbzfBqGDl+niySn8pWtJHPuO/FFDWc/DPoPPH3XGx7zNdqcL3qxPdn6PW3fcs7W0Z1+UGgi+eu2dCz8YTFdtpkeI/i71kyl6EWlYZP8tyL/zA== 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=u6CD2Ca2T75xtBaR82rnXRMIKFDHu6ZHcG7APYtvi+I=; b=PKyhePitMommsnSeVfdwZ9NpF5FHyaLloIfTKEAHYt/SzLCu3mMzjmW3hnCfzfTzz4sRVINqb+hiUHsFpRcRJL8lVyidQu2ZAp96pMk5JmkXOR+vF2fXNXwh3/IlpZURCob+xpEk8tVVDQ5r97NhvVIDzQ9E7g5J6Iej2eD6lLrBXNTpHy5yd9U6ZmHNwF3NQCSKEZ4oKS1GAt6r3/UxAfzS2H9H3LaWm+KpQa2XRV8XYhuav85GIp7n6wBTlJQJaE+4cJOqiIDTrNbUTrlrIdB/f6IGWxutWDndoB11PMBwFsJjP4C/+LdRK0jnrT6Gx9ACqcj+xOdqeNEH1mQT2g== 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 GV1PR04MB9216.eurprd04.prod.outlook.com (2603:10a6:150:2b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May 2024 14:24:34 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 14:24:34 +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, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me Subject: [PATCH v2 2/4] nvme-tcp: use sendpages_ok() instead of sendpage_ok() Date: Thu, 30 May 2024 17:24:12 +0300 Message-ID: <20240530142417.146696-3-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530142417.146696-1-ofir.gal@volumez.com> References: <20240530142417.146696-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0001.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|GV1PR04MB9216:EE_ X-MS-Office365-Filtering-Correlation-Id: 372f8a20-b1ed-4eed-d18e-08dc80b43a74 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: +OHgp0t1w2/0ziLaquYowxwqU+DM/YqgWPsocd+FYT+zYKtEqvFQ9MHpXCm34y4+E2jsbnaC8Oel3E5WevqapHc84ELDXH3YMNZsYXm51l5r0/DZU7EIKVkAP8ZDB6blj3BWKoTH9vmgDFKyNfVeBYBHt36bDF4B9OcyeE6W67X+nD/D8gm3On/gjhwtQUJ1mpzBZ6ShcpsXHitsE1ox+xZGF7kO1nXBE14JAqwPXA66Nxm2PjRZb9Jug/e1xvHYlkalQElaR98Y1Qe0lDWZ9Bp0Z8+VICLsVbOZh5/UGZKXAZh5dYKmhWcFbyMdcdgcdTflozq16ChAUHpqSdGuPmK+sfDVASylUeoECBzmO0WqxLa5HWW1FJQt1rKtcgYi5tdQxZEHjm+pCOsOE0XQC9NLMvNjlqX4JlxZc0sLDX2CnZB3gN/9eWkxvdY6xDKZgWiYCv78o/cgwoxMHRWM4RyzHLOZp1pHWA/G6bKNLSk6DN1Si9z+/Y15Csqrxum6JhA+3SAdAYt67XQtWmewyte6OCJoG30ZfVrQhKzPLPp2JZ76pDWve1u99JaHaRKv+PuWwsY7h8xGpjbFp9jT+bZNhrSRRL3QZ2VpYiuZvy2gz5Kss2gbJf0wS8VJTjics6TZ3pWadD45dkFSwe9RjjgaYK0MBeAMR6n7yGzO3gwNIGUCuP+qbCaY4VMJiMwr6IkW8bqhAozQFz2IKGs5lUMn71QoCTt9TZIlcf+elTuy4BdqiA9tkcTyV/gkZPGkYjwlsJheyA3m+03K2xIcXWhPfhHjJfsTqskJy8WaHH2/VZaNUWiHY2nYeMZ8JX0qKVbipvSwURhALSBgztPuS4NH5ep3M0XPuyWxP1TSqscwXRDmCwYIDgPOWvnSC15eik+pLXmlhCveZAdoJ0urt+k86SSqsFbyeDmwxBi9jldBnyYpbkp1yTE9jYNTHx4/gnX6HSWdlegSux2ylPR5vYEvvJXbnjWkPAxfYNx/va4kfIrpoJ8zj255JKlOVLRTv0157ufr8K5wGglojIkjAax3ragT27kl3FP1wFT3eoVcpGdpTSXIBYpFsta1xddLZAvAXBHkj9xHkyP061v2IVOiF/nizZzec+MAyVJmBSoDCcHECWikDqEeUhxJhZQHNUVBP9yjamCgJwRFdPxgTvRDBnoMEyhOyIbefYAn9S8zJjEVJHIfIyIOXcQG4kj1BdjdhUONmQ2idJB+YRosLL81cz6fMq/5z2ciBwzcoFfB1+Kd1uGO8oQRrtVii/8mmIEj8Em35LQ4d4QmgIgn3TUinLzCf4Wl8Hg9oErCzWxZMYcqokxQq4kgOXEF+R+fzWD3RnxZJ/JZLkQOVligxA== 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)(376005)(7416005)(1800799015)(52116005)(366007)(38350700005);DIR:O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G2U0ZJpHrc+GSj6TSpbI5GBfCdenrIeUGwHgR+efahxqLlI5rO0qy9/iT3EFlM2RdFrMdjdPdXl55GPmk72KWQrk5hLZYUdrlkUoxQ/nXbHMp3UTESRa605YGj8+qcIhJwlgJ8sJU2K4Zkod+NOB+Idbt/ZNxQd3kiBmTGYOPvpdLO2dh01uUMK9QpsLGHycygSVzXMwIowzhlQa1CJqsICxfcgU8l71g4LP1Cf1mzh0cYOLe9jO6HEwSvcKJrFvVOF54KWCUVKbR+noNw+DZkx8DWWr1XUaKmigNudEz8x9qdo7CbtvD4m2qTzRIbFqM7roTxKy1ef+sYJLrPW2Be7P/ezFk2MUtrWJNh8H+zcI0MqXwEwvu0YmeCgLrOlQQOr+fJHK+NFQIsX1SvnQAbZ64aEuvmyxTQ+idswytd7Q9QB7GCYY2GzOHoLRQj4PXPYIuaWNZCRZ4FZNH85/BGiBknd7NaxtdVMLcevVFI66apnTNos3CveI5f73xeGxgEAmbJRJRJig4Lg22wMDhK0ARTAUnPTHsUuSKlHZotdZBogW4LEQb8N1DSU6FbxCxQVZ6JbD X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 372f8a20-b1ed-4eed-d18e-08dc80b43a74 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 14:24:34.4810 (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: RQNVMqOyFbj+dufFXMQbdAO45UsQ0wGpUHxlK2aJcP43KljOMTMUcvuaRN7XAvzjwX4dpH7swMtuBZI1RDwLow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9216 Currently nvme_tcp_try_send_data() use sendpage_ok() in order to disable 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 nvme_tcp_try_send_data() 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 disable MSG_SPLICE_PAGES solves the issue. Signed-off-by: Ofir Gal Reviewed-by: Christoph Hellwig --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 8b5e4327fe83..9f0fd14cbcb7 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1051,7 +1051,7 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req) else msg.msg_flags |= MSG_MORE; - if (!sendpage_ok(page)) + if (!sendpages_ok(page, len, offset)) msg.msg_flags &= ~MSG_SPLICE_PAGES; bvec_set_page(&bvec, page, len, offset); From patchwork Thu May 30 14:24:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13680476 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2139.outbound.protection.outlook.com [40.107.6.139]) (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 E92E417F503; Thu, 30 May 2024 14:24:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.139 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717079082; cv=fail; b=OQ/YSkpEoU+Cbo/4agZscNRkD3+UKtVBmKP0pqIavZ/04xcoExg2Ge3rm0TFLOhD1OadSlg2Q92hwWIiJacynb/t20l45M/LcP47QostNZsvm4wukVjVKe884ebs5k8c/0d3UkXiWDxIoQxZ6CcervCblIPf0/FPZo9epf//64c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717079082; c=relaxed/simple; bh=n+30LPrgh3ECtE4vwoN9GQnQtWDt8J1uBwKgssKCb6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=GbrKQyEkQREwFg7vQkKdrhLKIp+nda5r8n/q36cI7a4MpFnWIT+PIifUXtXq6SHEB/Q5U+2hdrqJ8+yEA6nOqwYoqzBFJTPDpxgELTn1/LUl1OWXz6pJ+ldCDM9F5QBDYJPfuDfUjqXp/mF+atpIhxbGuK009JgFbiqAZYlvRoY= 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=Hj7TA7Z7; arc=fail smtp.client-ip=40.107.6.139 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="Hj7TA7Z7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fqAn24e/KPfmNaV4cO96zWyBlrH/5G5T3ewYK89N0qGpG8nUWwuSJQz23TkX9nKODn2/ctxJWomct0Cq+HIIss7AJeTQ+A0xm7AnedUNKjgmu7A1HrBRq3XLThwAHP8+fLO16XSt5MRTzmyK3rdqrs6+kajF2cM5sk2COjOw1rZ4HDOe9jBFTfhmHGzyVg8nzFVTfgjQZChkiS99i5moBXN9GDaZiFsWqOwtUGb1gli1nw7hrw/J0h0C30zmKcADCaFcb2Oc33GYfSE28EotddqoJr3cbt7oSlICPqnOAniTYFw0cUqF1G8iSCU5v6yPEqMgwOs5A6lGHzOsx90GxQ== 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=mXyPTjSX0sG4zzXDMHIlAtzkqrxPxSoExsIIIIGAj/c=; b=UlGkRI38CJc9E1EEMnJgpmSwjilcDF2rKMOuvx1wV/p1+wRRk4iVzwebiJY4Hiwf4aF+IzLI2hHkr4flrg34KYNYqEPRRBXFXmMm0ryLwzdkEWclcB5hWGI1sRN57nVA32CHGnvO8prkPccbypiKpX62+38+sXNfBOCt0ENh8lfNaZY7KsYZtPeZg4G9MVnOmghA8OF9Tb/giLCiKrIdTzmCO/A/ntvqVbnizaap8Aa28b5pu1S0QrCeHpoSDAeG2HmSOVt837wkBND0jptc8kExsSDQq2xR8GwJufex4dJ40tgb9LA2BdyfqGiPahWGboqk6vrpt7w/Oc9kYn2H1w== 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=mXyPTjSX0sG4zzXDMHIlAtzkqrxPxSoExsIIIIGAj/c=; b=Hj7TA7Z7rzhsDjEJHqoB16FJAPQtyJsyEruSNMFOVD357UOI+oV41OfXw81PBVBSIXrY7Bh1J2rrNqUv+RACjjXFIPEbBPeqH6KZqAg1jb8xYc12TiAZa43Qakmj/+ITcY6RAJFFnxFOjYi5divBivWvq0HPA+BRDOhtKaSM7bYl6CSK+8RqKOnOblbbAHk+8QsvKhSWnCJ+VPjKW1Ek9GAWnPU3Ly+Z17tcRfFAoKOQt9sFFYVt4OTnKazzo0wzKqosJOchjdpcNMy70E3TQX3M3FMxlOV8QXsYxAam9N9dNL/j9D8hhKjoXny0LAeYu1WlM86WgiME0zVwQ7V6mg== 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 GV1PR04MB9216.eurprd04.prod.outlook.com (2603:10a6:150:2b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May 2024 14:24:36 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 14:24:36 +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 v2 3/4] drbd: use sendpages_ok() instead of sendpage_ok() Date: Thu, 30 May 2024 17:24:13 +0300 Message-ID: <20240530142417.146696-4-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530142417.146696-1-ofir.gal@volumez.com> References: <20240530142417.146696-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0001.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|GV1PR04MB9216:EE_ X-MS-Office365-Filtering-Correlation-Id: 96602cd0-cff3-4268-08eb-08dc80b43b94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: at8Roi5anQxV0RZn6xn2t7bWx0V8oQiz4G888lDO1gnv4T0LkYzUWoBpWcZ5yFd3pa+hYpY704ydaHVUPzA3gEmzI+Gjewn8S4bxSUE0juWZDuRABpbUaVZ/8/3XT5oL+YPTL3H/CuGLL+tA4a6vhm3BaLUlfx8+HrpQG6DY4ytRcejijHLfmc2aUMoZmafZ29LJwPAhlWPGsAqndteLSTH34YXcMpRNTprpj6mBwAS9mc3DIHrWiKgEWcR8Ph8bFah3KfCGgvEqZvPkiV5aFrrlfBcJ6s8bmKZEN2quhBKBq7icZ7kTtWiWj635SmzrE0Nn8ohqD+5RcAD5wxKg1Y27ntGpVkp1oV+X++/vJcnXyywDgARNROpGCPA9Mg6wz/KZa95tH86hM9g0m7EmlP9GdpdmJuIhvuxL8JzIyqp4C1YLmMbN9V+jHYyXf9j3LFOEB5QHePxcZE5BdM1HzyG87je9CwRCA2UCvGAY6aNXKd9sn+I9HLdg8bULNw8s85tRs1MB2GryNcG3VUgM8CGanuGdt5iptja7qs8rakuVTFCU9ZxwGysKivayy2exPFeC9uHsKhziOieST1U6GKW+O8Cur5DZlMVUeWyyXN+BXgiveqE02lrFt0MArCbjNN/plTG7LRIOlEz+cqjxF9m7gaXLJeWSZGJlvK/vMAR7663WLzRHiYXh1kQcgll40WrVRxKmxQ0pwu5FC91x3wUGxmJjTFVkXZtT9AqPUobNTDpOrPV9JAhXo89R1V87Nkp8NQ0f15gfje7bckaPQWNY1jsLCxQxRcOYvoMbu7PAm5TE44WJFm4z4vRsjjStnWqum/j1LlPC6gUeNJg/D2/DZJ1zkLWEODztWPd1RzzLugQ72LhwogkAqZbLZcVgpYLN/ddLegeajNEfgEqPLxnLdl1TqrvivF+tC1Xc0JfrkmhPlwx7ZAio9Ncqcuau2rIrWdgKVBRQigRXwe23L5AgaUmnI3CbALGnjBa5RJJF9AulS9cvfO3rx7fPOoEywECtJk8s3ol/5B8r13mqwrdErxfMeNL51G8K9BMkq6xvqCYXbAgRxB8w1bzyu89pfVZ6XqsLY0jB6YPokOrwP3dzo2CaILL2s5kWVT0Fc3KovZqA4JKAjAQyNUWPmYnTDGIucMJmDlwA6XkrwiJJ9kKLuRWSDmiVLL1XKTyTkSI4M2ytx69fTe2T9KI0tP1XA3wP6AafaHbl6daBwc8m22MfpyEbl/9/WAHj0N8B05n94jhL3b4SPS7AwMbuuieGC8T1yENgVhlhdSQIg5nY8y/wV3Gpw+P0ey6RrJuvyI0S+PJSWrg+aXYZDnY7ZYOVr9bTkYaRR4QLdViltUAUyg== 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)(376005)(7416005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /lmPfXsqZsfftnSXYY3iLgnzah9wmRMS6fJGeNKC4EvE2/tzqyclaMID8ytKsejFyAcnU3EFfZHb3T4mz811hqJyW8kVTYxX3UJ8KcG7NjsHEeZmROUpkU+CS197JrnK4l4f3qOonVX0V9VSKlG6d1KBigZmb3CAl/H133br4bYY9HFQANRCFjqiSnuWuMVb24JdIfDGbxIECCWYe6qTBigkYY2nGwa5SHsEb2SfLpzKnfVqFRI2+hnWqK3amjcPXURnuapUHIiUWYDpXum3LdYtfsxzDvwJKX3UGxASzWzlNcdktJls3vYMTJN9vpD8MAPW4Rf5vmAXEmFoYvFVZrNvz97rG0EzE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h/bweEpp7xVPUrgzlQMmTBNcu/wSyYnplzE41+9jeWyRnTd8juVMmqYQVb/wnc8vDZyj9obfan52XoazG1R8CTwVfI3Izl9eB/fmqIQbqzf8HkZzDZzv45E/cUHMSH7Iam64wV9ey0uuLYXBku2jZ9YpuKMBg X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96602cd0-cff3-4268-08eb-08dc80b43b94 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 14:24:36.2533 (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: SUCbeffQpUOvvXUa3qDMHhqWL8+QpQPpWqf21/pvFIU5Npwozm/49vdMFXnQM1iStAlhOihDbjOHTa6f+yC3uQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9216 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. Signed-off-by: Ofir Gal Acked-by: Christoph Böhmwalder --- 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); From patchwork Thu May 30 14:24:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13680477 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2139.outbound.protection.outlook.com [40.107.6.139]) (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 10F9117C212; Thu, 30 May 2024 14:24:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.139 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717079087; cv=fail; b=LWXsUtNIdkS3BzjHkPZ0+52dK3uyUToI19jriVJ11+kVgjlr9q+iE3oiYTewcKt0fIdIhz7qZRxMTGxHs0cbn8rRymG11s8QdVCPHwekiBSQwVtYWR3hb7zOSm4gwADFO944TOb02sPPE/haR3NTzfU6qmonnCy6HLsGGAfJe5A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717079087; c=relaxed/simple; bh=2+Im+2kXu18jMablAeBcJ/QIXTeWmdY+pzCZJV985fo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=PFXyNqGldMOTSvEeIEfgGOKapGeexFiMabBSjd+PD4FTiHgy9D4h2KU0KgmgQCu39VtPRnCSOPiQ0yJN+VwZ5wSGB/G179JtAxMNrMGOvwjUCnfMYOlKZo2dzHCO7POZ9WL1t9aujym5oadWvf6dfS1EtKwTw3ZAH/ipXO4b7S4= 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=mjxLnEl4; arc=fail smtp.client-ip=40.107.6.139 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="mjxLnEl4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CiHAveJnL6YbHJxKvpjO1zMgHCNvNtqKeIYkc5lHwF9gbFffN966JGI0jsghHcrqbsOyTWpIwlJg6yKs3BYYd49MW5ZmwcgrXgV7Yr+s9Z70UsLqGIYWQX4SY7hNQrRiiRL07bUK4roTHxaebkE103FZPX0udc+mzw5ovIBCVhmRSNj8VhhaanqzIVJrz82j0pwbl3bMtY599uokVcG1enUXRorqwzhfZSp6aIirqeMkibrBv7OwLhmWTF3czUsVvXGtBZXW0IgLM9b/QjG/hDRNVpUJIw6vpaxgAeZO+ctdbzxjtb8bacboOlSWOg5aXFR5g/rNytmnkSf83DTU4g== 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=1Rfv8LDVgRTz9jiC1OhOxn9YPDgrbU5FKBlQ7Avcww4=; b=QR/uQOORYHc+A/s/H72fskenTHs0t/tjAI1i35qQSq9bdJbYJUys5NsTZrZD1QhxDy05+pUtGA4PW+bSdirtjkC0chn+ex+AWm19yTz+rGAKzOR8k2evtpRHybuv5sEKIk4m989ShwrzanXaUr/lpfILXEb+Qjz/bKVPkoOXlhAQT77HPeO7bY6yEsqsWlkkiwQGGg/jAqvVQDn19d5QZnFBbX3aE3jJ9CzfGtiwvHIkMLxjEqYHG+NTUlCjgrqUbDnmupOEatELFFCZT2DaGZoToKEhgIhOikymLRiie37WiZPNr5Ok9TNLKK1OpurWArU/Lcb/l/D8W9rCnruh6Q== 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=1Rfv8LDVgRTz9jiC1OhOxn9YPDgrbU5FKBlQ7Avcww4=; b=mjxLnEl4eu2bSrIUS83OqzUtoh3HNuU9SLnJ3+YTNZ4zDLjDTLtWKtkQ2rY+DjdrXdT5/RBGIpKI2Q2/EEff+uSxs1C6ZNYRIv3uelcQ+fNNUhCY5WU7rAqTLSV9LasoPhCdEkoeIsJqctaOzNsmJbOfkwm5FrwamuoXfpsift87uU4ekT+eapJhLT53U8xPSo9iGHazg3KN02Hm/K4d2h+mZZ6qM+aBw+Yaw1yGLDPFMmyb+1xXNjbqFB4khsPIfD6/nfXXEUx7pQYWY+s7eMqKEmm/oPScn1bOKQvhQdQwtXLbtGyqNPEOr2BPTO2GwPPlEL6o3KsY5giHwW1sWw== 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 GV1PR04MB9216.eurprd04.prod.outlook.com (2603:10a6:150:2b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May 2024 14:24:39 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 14:24:38 +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, idryomov@gmail.com, xiubli@redhat.com Subject: [PATCH v2 4/4] libceph: use sendpages_ok() instead of sendpage_ok() Date: Thu, 30 May 2024 17:24:14 +0300 Message-ID: <20240530142417.146696-5-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530142417.146696-1-ofir.gal@volumez.com> References: <20240530142417.146696-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0001.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|GV1PR04MB9216:EE_ X-MS-Office365-Filtering-Correlation-Id: 098d4a6f-7f93-4ea9-ed34-08dc80b43cc8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: oTYtWA9BMj49DaXyDpz1Z37O4Y8mcHDr3QFsXZiX+ZzYgiIhFuBdbA+7FO7RndTGdK9lxo3cg6Dkc2tdmOJn9rd3GU+6r8bmGAPCHUdy8Qa5HXZMSaEf9sxdJSXgj0eglM7ItVl9sMhcV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JgKdXPhGuaw/2etocL8iRWKDdK6xkQLUVVByqQ9+w7zptNEEs8x7eGRz7NBTC4TTkb15OVAV6pkbFn4rfWDv3B1QFSjR4ds+Gb//CL8LHV6QGA4wqwbDiLHJzHLB+MUc1XXAUtD28Q== 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)(376005)(7416005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GneuxvJmFXOR1NzOJJ9Pd/nAr2iKW5NVnUVsqBREjttgsSj8pup4osM0f57sEerR4THBMKet1vLDXWI3upe+M9SooisaskjEZZo6fBfHGjyBZLEKfYvcC35AZsJcaz4R7rar/hzdNIHnAv2Ze8zAIgOAsGM4sMrE+uiLbGkAXfQMyMkCcl8DSMaGR61bHSfRJU3OlBPcmNcXFIwk+OvEAv/fgMrSmZAPbmL2A78UtdJBVhlkcKMaeRYsw/7QJUOcfj6e81/BwJTzqttwUHhc5ihehHp7qfMlKLiFqXmjY/E7VqQHABX3j7j976GWW0pFvZZZhmnuO5ni6JPW1u5zouUI+EStBidFfOGrPqcacxBLz/FUoEw9zO8MIZTTFToxS6G1eLI97qQUdwghjXVEKnAI/ntBOdnx6BaEq8rOZOdF6FNNhaG/FtllE2RhVBTZDEBSFFJsQpyfGJ3PFXcEXVYHYY1dmDHhW5dD78VYGnK+6xwxK6l8GWm/HFVqqWmWGeU+i4GWM/kmEBAd4SyNmm5Bk3oRS6XqztrnPQu77u1ysi489GMivkS1KztFi8/3kFBp5GzvTTjA+NksHgYxsVglL50hFiuDy3dsRg+kKVsjceSEhbhWHVECfazUpPcNEIbdzVSj9V3HL/TKmBafa0FMfTHTsy8D52GTwTyumxwtvIpccuuKbIBm4dW9nRsKvashgvU0oAlE9J5oN2Jmn2AG0S50T/sRYELEGeUKU4MPaq3UZKY3y2zWcrUiV6pc00VgQ3FGpsHexkiGWqrkaV++3aCZsPZaHssBsPxkED1lUyr5ZyeYWJ2sjSTYXgRrPttK9qByw3zwJgnA/J6ke1JXJ3T3r2WOs/yDOKON90VdfdCp33fa4ktETsxdLibIFi6YWYy9mHszbyHR3IUetW4ldncDQsOqVNOR+rtGyxrKxJNC78BrgqCozucgL8UL8Obr7+lTOUhTh6RZNJ3SCLMUwCRxaagOlp1FyC6BNVCpUjmCDcun1FHm7MzoNnpR7k1AUWVpW//H8AduKx2XpHqmFh+keXCALAiRKY1W6EPLOdISSR3E+E5SlQegjTQr+1ldAd0OFDPr4nGKmx6iei+w18QWMmmg0gGSD1NmHP16NT+Fz2DmAUWFhDKyLGfsXf9s2vB0hgV2YoC1pHDO1dQwpZWIreuEJ/mpCCfnVgbTmGC6nQu7KW50y87N0T61LsiBUyLCOlTU+uzRPTKUDiIOP9OLVrlMVS2VLJaPh8jKmS3OII0HdwvF6LKbpJSEWvb/6mWLp7REFbkQvVAHVovh5rR2RBiDQXahqPsUhRaXJeTmCIXhadrLkBKMn8gg+J4L+HBMeX6u36IhrXHp7+wavr/+Kebp/npKIQkLOO/si0hFpNTh8Iam6M4xUcMzV67GfW1YxG68Wa8D46Ta9fNWIUBChiqgz++5YvAGNTHLDP4ol1RqLQLvSxhVIhAuef22glrkD4ORVGxWeWxmV2x3CGf80sOxQtVs2ieC/3IgA56mW2cqaYkXKkgbWZ96kLvfq/QByPrui4q2HGWPnnACYtV9fXSR5lT7F448ydcMhUIFdHsHyj2nGLJDDLIL X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 098d4a6f-7f93-4ea9-ed34-08dc80b43cc8 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 14:24:38.2864 (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: rrDZeKBWZAoNXt1n+KcAUd3ZUOqddFaZEvFKWTJ44/IqmneyE+Hxuv0H1e5nxDQfCIf6NQjG4AJI+Mi2aiMIgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9216 Currently ceph_tcp_sendpage() and do_try_sendpage() 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 ceph_tcp_sendpage() or do_try_sendpage() send 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. Signed-off-by: Ofir Gal --- net/ceph/messenger_v1.c | 2 +- net/ceph/messenger_v2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ceph/messenger_v1.c b/net/ceph/messenger_v1.c index 0cb61c76b9b8..a6788f284cd7 100644 --- a/net/ceph/messenger_v1.c +++ b/net/ceph/messenger_v1.c @@ -94,7 +94,7 @@ static int ceph_tcp_sendpage(struct socket *sock, struct page *page, * coalescing neighboring slab objects into a single frag which * triggers one of hardened usercopy checks. */ - if (sendpage_ok(page)) + if (sendpages_ok(page, size, offset)) msg.msg_flags |= MSG_SPLICE_PAGES; bvec_set_page(&bvec, page, size, offset); diff --git a/net/ceph/messenger_v2.c b/net/ceph/messenger_v2.c index bd608ffa0627..27f8f6c8eb60 100644 --- a/net/ceph/messenger_v2.c +++ b/net/ceph/messenger_v2.c @@ -165,7 +165,7 @@ static int do_try_sendpage(struct socket *sock, struct iov_iter *it) * coalescing neighboring slab objects into a single frag * which triggers one of hardened usercopy checks. */ - if (sendpage_ok(bv.bv_page)) + if (sendpages_ok(bv.bv_page, bv.bv_len, bv.bv_offset)) msg.msg_flags |= MSG_SPLICE_PAGES; else msg.msg_flags &= ~MSG_SPLICE_PAGES;