From patchwork Fri Jun 23 11:44:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13290412 Return-Path: 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 DD48EC001B1 for ; Fri, 23 Jun 2023 11:45:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E9748D000E; Fri, 23 Jun 2023 07:45:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 673F58D0001; Fri, 23 Jun 2023 07:45:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49D288D000E; Fri, 23 Jun 2023 07:45:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3CB528D0001 for ; Fri, 23 Jun 2023 07:45:25 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E8AA3140EF5 for ; Fri, 23 Jun 2023 11:45:24 +0000 (UTC) X-FDA: 80933832168.02.3860676 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 3722EC0012 for ; Fri, 23 Jun 2023 11:45:22 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UzHNYP6Z; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1687520723; 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=glhkLT7gtlYemXxdbjuQcwEQJ0vm+GHQVqp130VY88sD4eLiZ1fiQmvROusDu3UqVTC5+M wrzSwEQL2MFTTPIHE5INlH8MmJOlerBFUJJpwgQgb/KrnyWQkKr1iLhJywB71c9q7t6NzL /gaqKeTOGO+yAxTVjJpxbnTFNu15LHo= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UzHNYP6Z; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687520723; a=rsa-sha256; cv=none; b=LtjL1cIzmjqlR/kLaprYgtoCTWXe8Ba8jVjdmUhlSO0e9sWSGCQsECYLDeJ4zZidOii//E tCHKq5j42cma6Da/EiS6i3QwJwkS0dkfojHRKpgMMkuK/2RWeqDigBYxQ7jQkMkwHQXeOt QFOQXjTa2ky8/N2DpfL3QCZi4LKQzeU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687520722; 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=UzHNYP6Za19pgiNVjw4MDxLM5mYdIaSrmyRvVqGq+LNFwti4eWaCifuJpTdc0+vHLeTK9A 5drBTm5c3J21vk8M3r5/x6aqigN/hGz82PfgFZoGqJi7dqnse07wjOVe5j9yTTuHRNzw11 WWpCCAN08kLZ+loNyrEGNfTeqzlMdqY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-155-woVC1FXnMaeEutQKCYvqpQ-1; Fri, 23 Jun 2023 07:45:19 -0400 X-MC-Unique: woVC1FXnMaeEutQKCYvqpQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 57BA529AB40B; Fri, 23 Jun 2023 11:45:16 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E6FC4087C6F; Fri, 23 Jun 2023 11:45:14 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Alexander Duyck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Fasheh , Joel Becker , Joseph Qi , ocfs2-devel@oss.oracle.com Subject: [PATCH net-next v4 13/15] ocfs2: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage() Date: Fri, 23 Jun 2023 12:44:23 +0100 Message-ID: <20230623114425.2150536-14-dhowells@redhat.com> In-Reply-To: <20230623114425.2150536-1-dhowells@redhat.com> References: <20230623114425.2150536-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 3722EC0012 X-Stat-Signature: 7hyfayze864khaxkxx4tupdazynanrfx X-HE-Tag: 1687520722-603431 X-HE-Meta: U2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Jfw1edT0RZK9WzSKTSVkqPjB4Pyb5XUalOzVa9Z0JZR0unRhB+qkfR6gmD7RS4ebRaTH62aN/adVhSM7SYzTo/zEWyNppJs4BWLCWtY8KIB+jHVe1ZeJu9LY+sBvaRMna1W3A5CsFQ2Ow3a7lawV+T0fD/xdzGfSNoly97BdTU6ulE1f1vZiIXcO6xJzOx+oD6VocVuQtgp8WlTy+mbxiubS+nRZ0/Bm9GIC6pzOWr3i0Q3J4NRQWDhEVbWxZ1hgOPQIRKGvsntwugH8Y83QQnMAfLZoDE4ZS2DcLqr/Asqjvc7yO//E0LEn/ZlGFRcPfg4kaaQ1QayjpHb+ey13ZKkhq2/XlKfOHW5iMxi7D3Ct1kHngPA/pFBB/rWUpbD1eB7+hA522rQGXAQ4SmVym+bxO1uOwa8o0JBU6lte1SYEu3RY9xO216s9kaeCP2iAKp6nLjZk2oi8+hXPLOY/71otVIiJQe1QuJJLF7e7PitlOoceGYRhVkwgJv/ncwl/sKQz1RL3pL 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: Switch ocfs2 from using sendpage() to using sendmsg() + MSG_SPLICE_PAGES so that sendpage can be phased out. Signed-off-by: David Howells cc: Mark Fasheh cc: Joel Becker cc: Joseph Qi cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni 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(-) 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) {