Message ID | 20230616161301.622169-10-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 EE158EB64D8 for <linux-mm@archiver.kernel.org>; Fri, 16 Jun 2023 16:13:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87D6B900002; Fri, 16 Jun 2023 12:13:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 789148E0001; Fri, 16 Jun 2023 12:13:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 651B9900002; Fri, 16 Jun 2023 12:13:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 55B0C8E0001 for <linux-mm@kvack.org>; Fri, 16 Jun 2023 12:13:43 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 24ADBC0CC3 for <linux-mm@kvack.org>; Fri, 16 Jun 2023 16:13:43 +0000 (UTC) X-FDA: 80909106726.08.DF5F1E3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 465C340007 for <linux-mm@kvack.org>; Fri, 16 Jun 2023 16:13:40 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=T0igldnw; spf=pass (imf04.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686932021; a=rsa-sha256; cv=none; b=OAwSL27UUoMznuw/0SUbN2NivspveVRai+l0ktQsktq0TuD03boILmIZ5s/gSDWPSFdCz3 z6AOLfKWOKJptv4hx1AJbqbwB1NbzKQW9alYHocs7tXeMe0A9sdZqIyR+TXkrrAvIfGPht +a85RKNz9eemjRk99bIST2K8xYz4ZRg= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=T0igldnw; spf=pass (imf04.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686932021; 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=CX0szcw738ZS8htZ0RxEmjBFgUMhbKSUPMuc1XxmplE=; b=V/nkwamxXxRLhLT/lnc0b1tLxR76tq0fuH2AF3sKVh9AY46K9IPrxJ7zepf0n8q55s/rTx 2OP8VX2j613y67c9XC9PscP3GOjVu9V1iamG0hWa6TJFXyK4Jxkhf9/3757XcgMVBiZiLI 0vdle8Z3J5EkNVSZeo8IcdX9jFF/4wk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686932020; 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=CX0szcw738ZS8htZ0RxEmjBFgUMhbKSUPMuc1XxmplE=; b=T0igldnwVU5O4dqeOJO+cgWjWePL8QBQWdqCG5AmQEWivP0frQg7DOrBcDmrvvhW2Wrvj9 Io5o74Ue8vCR9EMVSVrxmBjzlPgBKCL4CNlTKG79dozQfI3JJmcqtq1bc/J3f6vaqavDFj QR4F0SZchSzOvs/PLiHsLn3MuXIj6hU= 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-177-8EMyMs2DPWaeQu2vizf65w-1; Fri, 16 Jun 2023 12:13:37 -0400 X-MC-Unique: 8EMyMs2DPWaeQu2vizf65w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8823129AB3E3; Fri, 16 Jun 2023 16:13:36 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76298422B0; Fri, 16 Jun 2023 16:13:33 +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, Christine Caulfield <ccaulfie@redhat.com>, David Teigland <teigland@redhat.com>, cluster-devel@redhat.com Subject: [PATCH net-next 09/17] dlm: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage Date: Fri, 16 Jun 2023 17:12:52 +0100 Message-ID: <20230616161301.622169-10-dhowells@redhat.com> In-Reply-To: <20230616161301.622169-1-dhowells@redhat.com> References: <20230616161301.622169-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 465C340007 X-Stat-Signature: 4kn6w5mpzs3zpae3km9ubgya83mftbic X-Rspam-User: X-HE-Tag: 1686932020-706729 X-HE-Meta: U2FsdGVkX1+mH7DGIUuqzdnU/40fCu5TKZaOI/NjvXciQ32hgbg9u9nRAt4qmeaJLVIUjXUOB6nV1v69N1XAHCvZ1gjaSGbU3ot3bPSviYg0kkQslcCePeerIwYLknVR68R78o0Lkjy/9j3mGASQ6gHeu6OBqQxrdQz8rC5knWj0nt6XY+G3zv3lg9uhf2fTGpJts4T+4zvXjQGLfbLqhAsGwNsUJRJEthW/g8b3DVWoiSnIsBl6geS6vsFQA6IDNwD1TX5JbhLKkrpWLXeDtbBG8JKAeIEdoQYSW/NvaHTp5Ef6l3zZO/b7In+JBz/42WIHKHqaBFfLsaDA3KzLGmtHITyJM+0tR7/139+dTTOmbaxW2WxrewfjfLElzRCA5IKRIF5ddYrwoXmw8xYe9NFwKe1xOo+StJL3LqhtUgKNfm98lYZzgFCj5z+SJqz/pv2/oZKCyO3CP6FDYhP9TW67RzWzTNHTyHDywWhS5iTJ+iyGrJzWy7KnQSezbnRu+quDqs4Bz7ljfRVEytVk3GJX0kuOZ9L4NqRy9vo/495uIGHfcJBPkbL9fZxYUp7A/qQSef/fGXLnRbvHiXlFin4CLQcRnfb5gnHplhfKzeA7yHVkPxKFOAiownjUW9q8DKqbFL1aVpUlKptVVyZH8eGHKmWksslGgsOIPjqGo0FMtq/hYXnnv1NpwELIfuhZGHDCQXGg/d5Zon6Ork3og2A6je0zb6FRsh+v9pNpurrfk9/Lhmo3SzBO8Sl60dFRZzR+wXFijCDHCQHd2uJMxCHFilW1sgtrly+GE+Skqp5ijFRDS0GK1m7u+FVKfyWm/aTGlHO6JBF2jt8US0RQil9L7ehXG/t2gC9IPyZ9RktViCCELgd+TXtn/6/l34fmHqdn92p1E7AfRjBJtcDc+OT6zdId5vufPqzeKnnv1ycX2xy2s5ihq5KZFA6eBm+F8cMNdCbBSoP5KSQNIUe FOrJWJry pent+r39HJbaugBuqA4AfktNvQ5tzpx+q3CHePSp3wKZm3aBp4m5WZkke4WKGbwYUPjRRFJg7nrAKRzgQ51DnRxPueKb5EaOU5lMhpKEtpU+rWVNqcwd4Zo3X09Ldgyir2VEFajO5uy9C+LHJwX2TiwPQqwQSzvFuMeSyN2Zw6IJ/g4dXzpe2Vh6KWqTswgqkaklzxL/v40KuGxv1d9T9P//DYWYPderpEaKIRI3af6ZL6cKCm+kfDr5ihJHo9R2KOr/nA0jftxISgNRYL0RAOKtVrz/mNTDYBy4cR5mEj1Ei4WA+ZpNhv349xDSz5/iX/HJsQIvK+SiwTPISM3WPLBIvBO8EUXWbsWF6edH8iEC/m9dvun20FNAnoznKvG7IcwMQImf0Q3BrcArFAo3utAdg5L4Gvy96v76YVsbgb7Yq2hJnUuAUfEE84Z3n77AKRyiMzYdGyfcNC6QFEl1Px3ohSs6mKUG/K1b67frZbTw/d5dUPLYl9M3iBw== 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,01/17] net: Copy slab data for sendmsg(MSG_SPLICE_PAGES)
|
expand
|
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 3d3802c47b8b..5c12d8cdfc16 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1395,8 +1395,11 @@ int dlm_lowcomms_resend_msg(struct dlm_msg *msg) /* Send a message */ static int send_to_sock(struct connection *con) { - const int msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL; struct writequeue_entry *e; + struct bio_vec bvec; + struct msghdr msg = { + .msg_flags = MSG_SPLICE_PAGES | MSG_DONTWAIT | MSG_NOSIGNAL, + }; int len, offset, ret; spin_lock_bh(&con->writequeue_lock); @@ -1412,8 +1415,9 @@ static int send_to_sock(struct connection *con) WARN_ON_ONCE(len == 0 && e->users == 0); spin_unlock_bh(&con->writequeue_lock); - ret = kernel_sendpage(con->sock, e->page, offset, len, - msg_flags); + bvec_set_page(&bvec, e->page, len, offset); + iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, len); + ret = sock_sendmsg(con->sock, &msg); trace_dlm_send(con->nodeid, ret); if (ret == -EAGAIN || ret == 0) { lock_sock(con->sock->sk);
When transmitting data, call down a layer using a single sendmsg with MSG_SPLICE_PAGES to indicate that content should be spliced rather using sendpage. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells <dhowells@redhat.com> cc: Christine Caulfield <ccaulfie@redhat.com> cc: David Teigland <teigland@redhat.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: Jens Axboe <axboe@kernel.dk> cc: Matthew Wilcox <willy@infradead.org> cc: cluster-devel@redhat.com cc: netdev@vger.kernel.org --- fs/dlm/lowcomms.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)