Message ID | 20230623225513.2732256-15-dhowells@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AC77C0015E for <linux-mm@archiver.kernel.org>; Fri, 23 Jun 2023 22:56:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39F7B8D0010; Fri, 23 Jun 2023 18:56:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 326E58D0001; Fri, 23 Jun 2023 18:56:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A1288D0010; Fri, 23 Jun 2023 18:56:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 041CB8D0001 for <linux-mm@kvack.org>; Fri, 23 Jun 2023 18:56:06 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CB71A80368 for <linux-mm@kvack.org>; Fri, 23 Jun 2023 22:56:05 +0000 (UTC) X-FDA: 80935522290.23.36604E1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 00F4A140019 for <linux-mm@kvack.org>; Fri, 23 Jun 2023 22:56:03 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=guRayiJk; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687560964; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6qW7QONKdXKQCe18ckz4PBDuqjad2A9AyVw+035R3zM=; b=x5qTRLRlRetdiYRR054vUIjEDwu52a+3b3LZkIvNocvrGjKCB8N7oS6IHOWfCIoj2jXqPV cJejqf5swW2bnLkWQvRyo6HaO2h8vwQdillkwvKNimz2I9+H8rXxZqoEgEzcL7KL5C+i3z Lu4JC3E9ZmZk89RhGua0xNMdxtHVSfU= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=guRayiJk; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687560964; a=rsa-sha256; cv=none; b=zMZYzO7Ho/GL5+Dsf93rt3Mlxtb+/h47WisTjW7gvtaK++qTc6f2MWRDcMFzjs37iVOyLq BDTznd7JpY//MyvOmQtkfIeMK//BXPTInVOgg3KPYCNlbETsYdkwDwYPa5ADg3FfsBca4l YPbQiRJMhK2r6bbCzu1zThvwHOZ/0lM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687560963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6qW7QONKdXKQCe18ckz4PBDuqjad2A9AyVw+035R3zM=; b=guRayiJkGWDUKe8cvDufQG8DB0p50TtKJIkUyNQ+1UoLoaFcNGJUzvB6wxOSeN7jujFyDJ vpZU4HdczMuYAbVq5h/8zYGf90VjBHzcBoIRy8x9npSZSONZQ9/yPE/I5JZiBTrkS8qHrX II6zgPnXmvx2qSgxASdiqgU4bp7VPLI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-306-a9340YSgPS-PNmqg9L7xcg-1; Fri, 23 Jun 2023 18:55:57 -0400 X-MC-Unique: a9340YSgPS-PNmqg9L7xcg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 548C490ED21; Fri, 23 Jun 2023 22:55:56 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89A49C1ED97; Fri, 23 Jun 2023 22:55:54 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: netdev@vger.kernel.org Cc: David Howells <dhowells@redhat.com>, Alexander Duyck <alexander.duyck@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Willem de Bruijn <willemdebruijn.kernel@gmail.com>, David Ahern <dsahern@kernel.org>, Matthew Wilcox <willy@infradead.org>, Jens Axboe <axboe@kernel.dk>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>, Joseph Qi <joseph.qi@linux.alibaba.com>, ocfs2-devel@oss.oracle.com Subject: [PATCH net-next v5 14/16] ocfs2: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage() Date: Fri, 23 Jun 2023 23:55:11 +0100 Message-ID: <20230623225513.2732256-15-dhowells@redhat.com> In-Reply-To: <20230623225513.2732256-1-dhowells@redhat.com> References: <20230623225513.2732256-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 00F4A140019 X-Stat-Signature: pnyybce4r66rxwned7sn9jjkj6u6yy4f X-Rspam-User: X-HE-Tag: 1687560963-198056 X-HE-Meta: U2FsdGVkX19EiUeD2WYFHxU7FX1GX/y+g93oDTJurXuZuj06aKYkfMqJFJuGqSJs7w5TfDTHJh7sjNsUv5HxfJxR0u5r/9bk6cliiqoARlAWkOx1yYCNRGspmGj/EJS8ym/miwlz6lbTulecLl0KBHwHGZuuQTEBwEQ/PR+N5GITcPmBAHEDVDQduk05LaqeVrgWxK6MLQsydqbJgdSuBbJ7QQ7ErBfmDnJeJgQ/n7QUPH0b4SSrIi/crWqjwQEYq66izzwwQb72Lp3HrObj2UP621P/H8UmERkp6SReiiZYbVbowyR/BCb6D7mJIb3PFvCYetGEIVGIGYEVSnwZYozcqxIXXO2YiBNzK3hhZPTCU4dOgczwicsRFKjEyZJ9AhTqelWyFm30ZB9SyC+Gu9xjn3IA5P0qcGONTGbKtiNVgE5ac6KtgtM6h47Gm7fiQIMMW/tF/rEnLk1gP5ELhk41gLS8GPbWdLl2VbHcML579weFGTBk7uQt90tWmRv86PuLz6Vc9jYAmKmCKRiE1j22QGM7zjM7d7wGFv5R/SSKhR5jxjaIHA1dCuobbCd/kUnnH7eGF74DtEjFez1Kz4mRCFvwuVoDn5y3SAeZmFskxWRFprxTdooXDHdyvzm3aE6eNBcI61UGJundThrh8ff2UifscFwM6gi3s01Mok41KBFDHZYsS6pa4x4eusZEn5xPkvUwabiRh141s7bLvNVXaXmg6QZqxKbBeDWiMcmKekBMmUExL4xq4BJbm82SzQ8aP76teW6azvq1rjl6+WUp9dwT/Og3CNlWXZ7cCNSBBBhjJLkAq1b8B6VDPcPHAAVrgt+BhfWQjyZ02IPVLgv2RoYOzLrNj+TVpQUmIWzFO/BHbYP28VlzuI0TZhoeIuD/4o1RP7mH4VkDLS3KAd3fe4YsDCChyduny0Naxpo+bTaHei6OSseNKMmfUn4NrVCwyeioZVcT17k8M0p kpC3SrrF QRf62uYPjLk0iy34aokD8j/279Nm03nv75eTbMgFZHOMDODQ2qtm96A2dV+a91+NuRghz5gWeg1oBoiO3k77fWhhSimJaCV25FkyA4KRmn796qutmil1gmFkxMM2aKHmGYKU0rJF8I0wvbme14ej4nGqRJY6XtAd840EnlxuNwRgaCEMzP7rPaHuMvGVRJ7t1r2M/HQFptTScD3nhr0skCgfQaY/78Ok6kOoNgLCkF2NJhsvvOcOe/F6Mdqu9JaaNxYAddxMsE9hua6+0WmXAHWOZSq59fHjQIO+mRMbZBvDb9FknTKY+qLtiUe4/BRvnUG/SlKQU1pvHfC3/hNLwnbbpTXHTQSTNVS9O/+8kUTDo81tIOzKtFG2S4AFuXETIertBMK82Q0Ndr7bKyOw1K4DscIz2mOurkjNqTzCz4mqKurZaPy5uT0oBHSyVvYWRYfQuIBCPmQ4CkogqdcDivvRpqlW3L6rLSgSSLMJ8aJazAzBQvXKnxsVBFf0MHy3g6RwVmtqlmSROsWdqWF6SO9Kl3VMykEG8SkaGT4MMUGDpMQLxOqddZGQNZG2IOVp0WmObtECSaYWzEwl7w8Y3e62E143mdaIkPw57 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[net-next,v5,01/16] tcp_bpf, smc, tls, espintcp, siw: Reduce MSG_SENDPAGE_NOTLAST usage
|
expand
|
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 929a1133bc18..960080753d3b 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c @@ -930,19 +930,22 @@ static int o2net_send_tcp_msg(struct socket *sock, struct kvec *vec, } static void o2net_sendpage(struct o2net_sock_container *sc, - void *kmalloced_virt, - size_t size) + void *virt, size_t size) { struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num); + struct msghdr msg = {}; + struct bio_vec bv; ssize_t ret; + bvec_set_virt(&bv, virt, size); + iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bv, 1, size); + while (1) { + msg.msg_flags = MSG_DONTWAIT | MSG_SPLICE_PAGES; mutex_lock(&sc->sc_send_lock); - ret = sc->sc_sock->ops->sendpage(sc->sc_sock, - virt_to_page(kmalloced_virt), - offset_in_page(kmalloced_virt), - size, MSG_DONTWAIT); + ret = sock_sendmsg(sc->sc_sock, &msg); mutex_unlock(&sc->sc_send_lock); + if (ret == size) break; if (ret == (ssize_t)-EAGAIN) {
Switch ocfs2 from using sendpage() to using sendmsg() + MSG_SPLICE_PAGES so that sendpage can be phased out. Signed-off-by: David Howells <dhowells@redhat.com> cc: Mark Fasheh <mark@fasheh.com> cc: Joel Becker <jlbec@evilplan.org> cc: Joseph Qi <joseph.qi@linux.alibaba.com> cc: "David S. Miller" <davem@davemloft.net> cc: Eric Dumazet <edumazet@google.com> cc: Jakub Kicinski <kuba@kernel.org> cc: Paolo Abeni <pabeni@redhat.com> cc: ocfs2-devel@oss.oracle.com cc: netdev@vger.kernel.org --- Notes: ver #4) - Use folio_alloc() for o2net_hand, o2net_keep_req and o2net_keep_resp. ver #2) - Wrap lines at 80. fs/ocfs2/cluster/tcp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)