Message ID | 20230620145338.1300897-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 938B1EB64DC for <linux-mm@archiver.kernel.org>; Tue, 20 Jun 2023 14:56:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 309DD8D000D; Tue, 20 Jun 2023 10:56:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B9DE8D0001; Tue, 20 Jun 2023 10:56:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 181DE8D000D; Tue, 20 Jun 2023 10:56:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 027AC8D0001 for <linux-mm@kvack.org>; Tue, 20 Jun 2023 10:56:53 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 6EC231A1169 for <linux-mm@kvack.org>; Tue, 20 Jun 2023 14:56:52 +0000 (UTC) X-FDA: 80923428264.17.73B3DAC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 9A12A18001E for <linux-mm@kvack.org>; Tue, 20 Jun 2023 14:56:50 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=jWE18q01; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf24.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=1687273010; 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=zfD7IU8b5oDc9vGWu0vJKGIZIgcgMpkTCMW9XC+nzVCRNbaMHoacW5CH4mDSQw9NX3+ABK oNSpv+BwnopFqx73ZvfRb+vczPpOPfC4EgXJrIYyCIRRo4nZwfIeZ37vClDk7yisgfpdHT Xd4yD+oHN19OZeQprQh2Fm3aI21TZUw= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=jWE18q01; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf24.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=1687273010; a=rsa-sha256; cv=none; b=uo0UGe2Cc/2i/lRKbilY40Nl2scQHyA2zRQxRveXJuyiw9sYJaN/lXHnuk1N3G0NckYZ2c ViEPIfXgOQIJC8KkX3UIvN63y1XUGyCJquAMx70kQx23gTts3YDyOaHNNQy7lxolyM++oU hsVWnwQh8VNL9476XeBjgPsbGZJcIf8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687273009; 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=jWE18q01LhPP0e+dexrU18mFdZWZSsQIkRz4L9Td4ppfexkM7ka5qd4yrg0b9lkaGHoHUS Ige1i1haVQuxEmPOono0J+8fI+T9qAvnE7CX5dcQJUfL7GM2m03mvrdknjI/7VVBRHXyzu wUdC4QpbDhFpBVPuub0oQtI1N5pZUns= 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-398-CpGHSxxIP-O4lq_Pb2IfNQ-1; Tue, 20 Jun 2023 10:56:37 -0400 X-MC-Unique: CpGHSxxIP-O4lq_Pb2IfNQ-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 BD2BE8A51E9; Tue, 20 Jun 2023 14:54:22 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B0949E9C; Tue, 20 Jun 2023 14:54:20 +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 v3 09/18] dlm: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage Date: Tue, 20 Jun 2023 15:53:28 +0100 Message-ID: <20230620145338.1300897-10-dhowells@redhat.com> In-Reply-To: <20230620145338.1300897-1-dhowells@redhat.com> References: <20230620145338.1300897-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Rspam-User: X-Stat-Signature: zgpqefpz3wptrj448cp31h1565rkfccu X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9A12A18001E X-HE-Tag: 1687273010-512172 X-HE-Meta: U2FsdGVkX1+h16j8pheODmWd2NO4ecvcABVeqG/l9cC7UHcPwlFwarptp+l4Ze8DuXwyNg7g6OibuiMgTb19cbOdMOCgNfSkIbFrPPBdwuaRns0+ADiLIdR2QKppuj/DiOI5CJrHIT20+10ABk1jr5MfLtW0C6gu5YHpfUfvFLgFiBaKL/VE5XI7EKY56F+ZpEGobX487FueC3FGSxdqud5Wz+JXq5usi75swGlMnAKv5V32x7EbFZouZpLZnyeYPueX9rwYEm2fXJUttVIxHkWyL6BHQwBCLeC+QoLaXuwOcj7iB82Ej/QL9decDj/uQTFj9Z4DsBk1q1rnBelZxoJsFg5Rf3vQp3RP4g2qqFv3Dozrwb48C4MIbCycZj4Eb8FH+kqdVSaZFPiRaFI4qhMDB+VYDRHNGg0/yVO9ptdt4gfCsjuRIVXqdFFTG9Ywidw0yorS6dF9Zd62usgK2LmePDpjvLxzvM7kpwP9Y6M9+q5Hrr/OZwhYaMeKYcdK+6gGsRAdbZmaYkp7gw2aVxuA1bJY0NfXKptosBGlwacpykqDPo2UjlfDE4pdXI4cPyuwa9ax+I9w7/x537o2n6/eWjLLSuARsUv6FAq2tOQxm2MAuGOtUUTvdILubaw2c1AW777eb68j8cvlGHLTIqeKXe7TIyDadEPtS7zmPuh5WnE/VUX0uzXVZjc3CgS/C28dd6qL970iM+5g+4nqPi7f3w9uAFZc0eoyqe/optftDb74012H1BLwadXhZYw5c5/QInWkapeLyIgNtVhSkcDe65Jp2Tms1vw1mxI3mLTWiqEILZZkDjrOuw7AOaGHvnibtCqgWp8juKKQcsPLKBWX/dYmVneDWU/6LLC1DM9sdeZefBXhdNTMiaBKzHbkr3JvnMTcTbSjfPhAxJEiP1caNTQvfzIj8WsA02Q/SEyMujQiGsOSmh4u48zxZdcBImGsrld1nNYZYhHHwq9 BmDE2Z1R T82jcmdKeAPpfR4vaOf0GEm1EVbuwf+TFbA44YqmoJ2pv+DIGIz8idpREeaRYTgyl8KdsfBYDk4wxTotm7fX4f73Cxsythlsw/Zpt1ULrIsxasg2UHwRjpbnIFNQuZKZAey+gK1HMC7EMt1WC45CpG2HQoMTTnmvMcXk1bk1nfK90cRldEA1tUPlRNMIYA7FyizLVnz9v6ZoYr35A5656rsxOmRIhQAXPE908Y4gqWgmYC0H4XlydK/G2B+dytYaghn5+1SbV53WaE5HUOvStSol09lZtwX+xTMZa/XkhMEcRXVQ99i2KaB6y4CxkuqiGdFBInThQ7plHIw1K/i1z6Ke+05Xq/V/HeYONsmR0KlCe60+/WRWWeUmWV8BFcd0/a81oNlzpzn/FD2Xnr5W6t4pc1fCXpf/I6LeGnL9W9QxhvoXed+oD9lcAEZgO78K9LVpMnTPHa4HP+6QISyIxxNSDwmGkMMKqblVR6b77MsvWyFaG1f6LcBoHaQ== 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: Switch over users of sendpage() and remove it
|
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(-)