Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34484323rwd; Sun, 9 Jul 2023 13:07:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFj4dAuQNG8MtotzexpQfd3PX0YPgJRE3htKFPfZimSm35tlOjymqTFtEaafwdqVQDX7juN X-Received: by 2002:a05:6402:150:b0:51d:a012:ec2 with SMTP id s16-20020a056402015000b0051da0120ec2mr13431793edu.3.1688933227546; Sun, 09 Jul 2023 13:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688933227; cv=none; d=google.com; s=arc-20160816; b=oFeGl19PHcj0zPZ2nU8Nj3Fhf27+UTVLrolsjiWeLWTzKWAWd2yAf8lVEqGbPRX0Q9 x24iTCi1g66g674dljehfncmNvG5f8qgi1gpK3GqdFtg7yekzgQTKIQh6GvMm+G6tlgE NFXbGnmOSfnuRhreKTIhT6Ny6dCQqmBIAFM52iTh3+p0h+yCUBV7ObXneiqIIU5VcLof wQJ3V/U7W4Ywo50lujpnwmMUbBVz804EPwZNAv0MfY8MWQyjGsnU6qdOMiJL3KZvO10c hbcfNcNNdZkxmdbAXKduojc+Himyod4cxjHdr7/VtJlK74qzR98SBytWtFVl239IhEEo Wxyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=oJSljRHEqPa1VYx5AWmKAbQJIqrPB6zv6Pe1JXLBY00=; fh=JSokujcKmmVWB1pp3634RQDGQxQpYmZYbeR28KOwCXM=; b=jG5spttO8QXKMkdjSc5CZwTZWbgdoL+mTR8+U6gbQxGF6ZLGkGPHQUMlzVXmr08xqr D+KlZOte6djVK9QNI2aYK4E9DfNwPpckxQ2+ho0FXRJHScXkBQIr49qQgA3BDnefuL7u irI4m1xcl+0knxJmi9yadPEJI2vQ9JeBFGjMFl3pm6mtsY8DeOQPA1Z2A5XIVZxpmx/4 6xpsvKWiqDS4y+YtH/R9lF3w1rSNAKsBSOepJ/uyaXNwTvP2E5KrJ2sLaj8Pb4x/+yvD /5lQyCWR1jRx2lPFy+Q1NCGYrCdiF5jGrRcpJ8ArJ4/u/YFwMDPZhqdlgsMxFWibhQ2e 8qAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6poD2pO; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020aa7cb4a000000b0051dd3277614si7440165edt.137.2023.07.09.13.06.43; Sun, 09 Jul 2023 13:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6poD2pO; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbjGIUFP (ORCPT + 99 others); Sun, 9 Jul 2023 16:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjGIUFO (ORCPT ); Sun, 9 Jul 2023 16:05:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01D19FE for ; Sun, 9 Jul 2023 13:05:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8F92E60C20 for ; Sun, 9 Jul 2023 20:05:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDFFCC433C7; Sun, 9 Jul 2023 20:05:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688933113; bh=fou8AGJVg7txseqewnRn0AjTBVgDNvNRiu8TRqNRdGE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=f6poD2pOHsZfS7G83N4DG7cvKaNHC+YDY9smk8KyAG2XOVDPhknxpkMxyUIjGeF+p 0qVP07AC3m6xEPs7N3R2+0J0H4Y9XSDtyyIMEe3z7LBO01oVWMpzkz5nz5cbgntMZR e958Y0B8jYu4qW76Xpl1kFFIvywTuPtCZSyuMhw1/Gf/XyLPa2wjpx4Mg7r/Mizgxp h1NhYkUy5QZr2X0VZL2Hu26xlxhWtP/w2G+rFdOiw2OE+VKh6OmUpto3ZhIdX6qyOK tcbIEKXWVTIbgsY1sD+S+G6XWADllB8TuYcGfuywyYBu/4pcHmrm5u/xm3ys0WigAy bCeJZex0qCE/w== Subject: [PATCH RFC 3/4] SUNRPC: Use a per-transport receive bio_vec array From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever , dhowells@redhat.com Date: Sun, 09 Jul 2023 16:05:11 -0400 Message-ID: <168893311179.1949.11410720662404392708.stgit@manet.1015granger.net> In-Reply-To: <168893265677.1949.1632048925203798962.stgit@manet.1015granger.net> References: <168893265677.1949.1632048925203798962.stgit@manet.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever TCP receives are serialized, so we need only one bio_vec array per socket. This shrinks the size of struct svc_rqst by 4144 bytes on x86_64. Signed-off-by: Chuck Lever --- include/linux/sunrpc/svc.h | 1 - include/linux/sunrpc/svcsock.h | 2 ++ net/sunrpc/svcsock.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index f8751118c122..36052188222d 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -224,7 +224,6 @@ struct svc_rqst { struct folio_batch rq_fbatch; struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */ - struct bio_vec rq_bvec[RPCSVC_MAXPAGES]; __be32 rq_xid; /* transmission id */ u32 rq_prog; /* program number */ diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index a9bfeadf4cbe..4efae760f3cb 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h @@ -40,6 +40,8 @@ struct svc_sock { struct completion sk_handshake_done; + struct bio_vec sk_recv_bvec[RPCSVC_MAXPAGES] + ____cacheline_aligned; struct bio_vec sk_send_bvec[RPCSVC_MAXPAGES] ____cacheline_aligned; diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index ae7143f68343..6f672cb0b0b3 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -333,7 +333,7 @@ static ssize_t svc_tcp_read_msg(struct svc_rqst *rqstp, size_t buflen, { struct svc_sock *svsk = container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt); - struct bio_vec *bvec = rqstp->rq_bvec; + struct bio_vec *bvec = svsk->sk_recv_bvec; struct msghdr msg = { NULL }; unsigned int i; ssize_t len;