Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2777447pxb; Mon, 19 Apr 2021 13:45:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzVOIPvp/FmJMU7neeVjol2e7drvYUK8/vLxXIG79Ii9IiCMoV7ToVcbjOQU+RuYePFv5y X-Received: by 2002:a63:78cc:: with SMTP id t195mr13220866pgc.196.1618865103055; Mon, 19 Apr 2021 13:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618865103; cv=none; d=google.com; s=arc-20160816; b=Fn3KK+QVtYZIUsneCXU2diike7eGS0SRJxc07p4b5+Qnu9n1tRnBNthpdV9gUALvcY Gg0VBiWKJoFPWJ4Ga5/IzNH9Usy6o5jgMtAO1jxCFFuSFmXkgfTNTdjug81SfgMRi3LG UFZ/Y4T4VkZga2gjKzDaqCbQdes0l7zJ8iWS8KIz/M9J32JYQhUOPQfwUXqGoT7KVdJf hYquTvqvQr9i5XCyc7gr9DGfB5k+sfHCB0t0dni3lsOcQ+8n497ej3Vgy9fcBROze0kp sBRnRkMDhnaJKA+9jIQwN1X28bEYeT9S8WFJnEwTgcJjHV4ocxjHTIoMjWwrFPoG0M5h +pBg== 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; bh=h6TeBMFW7x3rEUrzVc9/ae2mVZVwRBw4j4xvhqDV4Qc=; b=Y3wbSKZpke7xGRW0rPPtgKVeJKEBSfz6z/Ab/oVBTJeUpVETUTxjo5+K9GfvY7wHbn Ndxgama+0nVHQtxZ6To+e74IhLOriA6vuHlQge5nGzoIEm360VT3zw9JKfnnxPhKf0ar 3te3xKl5Kh6f+5maldCcF1ig9uouk8mWBg1RdzTcqw/N/RDqhCpGDeYlb3ztnIzVE5cc bSZ6ihm4E183YOezPEuQlDcbfhk719+TMDAwAKfTcmzVwYQyzg4nVSizd0aH/t+BW9U1 UuYKWt+mWqfy9Qx6QnbLwvubDwUY+oyB0KcUEC0cdkISy83Ik/LSsZXw1vyHqcMv47ye x0bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si333427pls.2.2021.04.19.13.44.49; Mon, 19 Apr 2021 13:45:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240487AbhDSSCs (ORCPT + 99 others); Mon, 19 Apr 2021 14:02:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:40922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240433AbhDSSCr (ORCPT ); Mon, 19 Apr 2021 14:02:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1849061107; Mon, 19 Apr 2021 18:02:17 +0000 (UTC) Subject: [PATCH v3 06/26] xprtrdma: Put flushed Receives on free list instead of destroying them From: Chuck Lever To: trondmy@hammerspace.com Cc: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 19 Apr 2021 14:02:16 -0400 Message-ID: <161885533627.38598.12133596202333658270.stgit@manet.1015granger.net> In-Reply-To: <161885481568.38598.16682844600209775665.stgit@manet.1015granger.net> References: <161885481568.38598.16682844600209775665.stgit@manet.1015granger.net> User-Agent: StGit/0.23-29-ga622f1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Defer destruction of an rpcrdma_rep until transport tear-down to preserve the rb_all_reps list while Receives flush. Signed-off-by: Chuck Lever Reviewed-by: Tom Talpey --- net/sunrpc/xprtrdma/verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index d8ed69442219..1b599a623eea 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -80,6 +80,8 @@ static void rpcrdma_sendctx_put_locked(struct rpcrdma_xprt *r_xprt, struct rpcrdma_sendctx *sc); static int rpcrdma_reqs_setup(struct rpcrdma_xprt *r_xprt); static void rpcrdma_reqs_reset(struct rpcrdma_xprt *r_xprt); +static void rpcrdma_rep_put(struct rpcrdma_buffer *buf, + struct rpcrdma_rep *rep); static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep); static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt); static void rpcrdma_mrs_create(struct rpcrdma_xprt *r_xprt); @@ -211,7 +213,7 @@ static void rpcrdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) out_flushed: rpcrdma_flush_disconnect(r_xprt, wc); - rpcrdma_rep_destroy(rep); + rpcrdma_rep_put(&r_xprt->rx_buf, rep); } static void rpcrdma_update_cm_private(struct rpcrdma_ep *ep,