Message ID | 20230316152618.711970-27-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 39DCBC761A6 for <linux-mm@archiver.kernel.org>; Thu, 16 Mar 2023 15:27:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC2C5940014; Thu, 16 Mar 2023 11:27:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C4AB094000A; Thu, 16 Mar 2023 11:27:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9CC6940014; Thu, 16 Mar 2023 11:27:38 -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 980F494000A for <linux-mm@kvack.org>; Thu, 16 Mar 2023 11:27:38 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 649CA1C64E3 for <linux-mm@kvack.org>; Thu, 16 Mar 2023 15:27:38 +0000 (UTC) X-FDA: 80575140996.25.937B5F3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 9B6AF40028 for <linux-mm@kvack.org>; Thu, 16 Mar 2023 15:27:36 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SRCAwBoe; spf=pass (imf27.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1678980456; 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=6d/Oxl1Cdu8ybDL5tOgPD1gv3cW2fyMj4HBClKMadWo=; b=OkJcHCH2TSte+WvRUMSHnJ/mWhoLSzNjAAoU14fjbtULRSg4wLBFd4Fj8n3tImBSL6tddV TKd0qXmAxGcqizuE2jPBjD5CZkEUAmYweRGqcVN45xqRx/6mdUsx1RpcKmihvgg/vYj6Vf mTxD+wvSXFpF9vlZPqqh149exU+zOts= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SRCAwBoe; spf=pass (imf27.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1678980456; a=rsa-sha256; cv=none; b=OeFTylzNZSc7qyYgq+ynIHEIHa0NxuV3/wruzfi3jKKj3xo4LoKAXG2EOQd/vy6ALp81xL f/3VygYNVQ+IkFcM801oXwFygZYx9NuY3Ya2BXT1+cmHTkHCu9S1dPXMJiJQKD4Aq/8qBW J5Oxa7JeF94bDQwS9mobpPVgQeaHsn0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678980456; 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=6d/Oxl1Cdu8ybDL5tOgPD1gv3cW2fyMj4HBClKMadWo=; b=SRCAwBoekLpOuPsVR5OQ7R3SouOnwNaWXaP6sertbSCGkP8LBXOQo+XG7IoI9pil9r4TXv WWJrezE2l4JOXC5g0S1UjZsnaii63CcFMU++8ws+tO7PWv+TS5xpQINF1vOQGPJzS7z4IP VoR00+lKhmBV/Q3Wo6mpf8MFGBFAEW8= 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-630-rdzabOPcMoiPR4mi-J1pAg-1; Thu, 16 Mar 2023 11:27:32 -0400 X-MC-Unique: rdzabOPcMoiPR4mi-J1pAg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0D8C828237D5; Thu, 16 Mar 2023 15:27:32 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC5562166B26; Thu, 16 Mar 2023 15:27:29 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: Matthew Wilcox <willy@infradead.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: David Howells <dhowells@redhat.com>, Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@infradead.org>, Jens Axboe <axboe@kernel.dk>, Jeff Layton <jlayton@kernel.org>, Christian Brauner <brauner@kernel.org>, Linus Torvalds <torvalds@linux-foundation.org>, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christine Caulfield <ccaulfie@redhat.com>, David Teigland <teigland@redhat.com>, cluster-devel@redhat.com Subject: [RFC PATCH 26/28] dlm: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage Date: Thu, 16 Mar 2023 15:26:16 +0000 Message-Id: <20230316152618.711970-27-dhowells@redhat.com> In-Reply-To: <20230316152618.711970-1-dhowells@redhat.com> References: <20230316152618.711970-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9B6AF40028 X-Stat-Signature: tpw85ccewemyx5dqabxeghdou7a3fh8j X-HE-Tag: 1678980456-342494 X-HE-Meta: U2FsdGVkX1/ZDiuxIP4OBUaPnRnY61G0WC3Oi7a7tu0jxdU4UySuNCzT4+TmfPujL/uI88kz3VUtofRQ3+1VXHSf/i1CHapr2ZVf+27/rnA3jvK5ISR0Xb1fPK9UIFYSOZQXPF/vG4QRMWsHmHdskC/vdJXqK082ydEuh7t7/G8gR+MiNcvElCwEfBQjwB+5Ef7zBEvGbk3hA46gfp6BYXOvtJ+LjRom+TH2PDLiIQbOLeNrDKv9EQOq3CROpvFQohQ5hSYbC6J1CmT/wSc9ShmS2nso7AiG6FQF6W/og+4dviXoYA9bVhsAkEYWiTgL8XOxoCU0GynhprBKjIHq8Xlk9XZAW+gKKPix4H9Wyo4NdkYgQD9Z0Q8VuBS12NNgJrAh6X01uD5K4ngEdH2kwaakEcOGYjPsag3vHaS47dVWY6ZmB2QanvMVRdm1Evl5qGbd6ikbgPCDOb1OIa1zquhhXkrs4d/kcv70YghwLM0BQxIoD4jOCKS5p3XAv0UXMb9ikyCs536gAyKIYidW9oi3dibaoJNG6f7+E6WPZdxI291YjpMo4R2G1uIn3SY7CyZe+7JYR+AfHTERC/rolwAjDjz5MtQzPsemax5dbGDHNanaqgayOx2/2Nqkb14V5flYi6fdALufNjwayyuS2o/ZSDe7W+nrgunMtuI0tlwSyEXY4nmhYc4EPnS6pVOjQwAwULsM/55pjUjYW6vlFu8gG3nUmkc/a2ozzBWqpPRUobOKezlflx4PDg2CDW9E7x9y+uK3O4ddpO8BW7UhuDRI70mtMHwb8Ty0VFzK2Q57xD+kIhyJimD2FS75y8KCPpJjORcM0Ji/6JWKS4z/cd7nXFI361npQqKL9FDNLdAbJBBnWlKoYpLK32O1TFF7K08u6jch4BNp/DEHHKyDakaPG3whOUoAbz64We+nkjHzaQvbv7MM0ddzDF+dBTCTTYKcqGpdUU8TRF90/sL c449mIKV fLm4A8m6oVnL+5sN/R75sD55skvrXorMNbOW81phcXGbAt7ckEIc4+nxM2YTsWSD8dC02MHZqLigxN2Rtqi7MghKssj+zHwRc7Kf5Uo44DPpG9GlcFjIZjbKrz77JzqcX5hviQO2DD7GorHGRA8QNCRsU0vQL+GxEtV9P3Jmn44fpfDTc++0tJHfykmukCuoJ55OhM0NdDZVv33XFGfEYXxT2U9wez+zJ1PB7MJfOjkaWRRZEgyM+97B/YC9qRRitLEDN21keUL2PFR0Ew1BhsQuJE/+QDaaFWsnnYJTAU/GewVCpsp0erqO+gUYarWO/imV9dB8We/FDA5t8Dr5P5NxXo9Il2/V1R8c03s0PMAKUOtUCNwIksL/SJugj5tkFPx7zufX8Q9RTkf+/lARqr54XyKxa1NdPOZaD2JCCrr7wM5hvga3/X2q8V2to2+l7u49A 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 |
splice, net: Replace sendpage with sendmsg(MSG_SPLICE_PAGES)
|
expand
|
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index a9b14f81d655..9c0c691b6106 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1394,8 +1394,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); @@ -1411,8 +1414,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(-)