Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp657593pxf; Wed, 31 Mar 2021 12:37:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5P04rp0WLHmWvRPsa223YWuK4mIVT1pqcRrTVXXv1E3djIuLiqdn8syLWDW3U8OU2BLf1 X-Received: by 2002:a05:6402:12d5:: with SMTP id k21mr5874508edx.318.1617219448117; Wed, 31 Mar 2021 12:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617219448; cv=none; d=google.com; s=arc-20160816; b=D+BJCVJ1ZuC7YGYZkepFmFk+sGhQY5xQxn7iJdnah1Cl9ZAsrQrMsOZBLRf2A2qB7l FwQ5LjKEPPF302yW7M6Rm1h3UdIVcCo/LZuGwX2AAoJDINSSijxh+orUB0o/dDKlJQxU FLLifni3cvW5dcy8BvFI03ubnd+B1q6EFe/DM0eNE8+uBdGcmdQIex0/4uRCY6VXEK3/ kYnTZpkaP/4FlgHj+IDlUF2Sqd1h2W47WLYoWRCS81/gM+EB+UFjD0cCFNfkB9AO4LIw +AqEMgzGw79CHnNPZOOzxrsLiqBEimZ4Bk7G1Nn/ntv+aum8UDvh2yP7r1dC509FqWdt GwZg== 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:to:from:subject; bh=fSsLj5FpkjArE9EaC37KCIXZH6G7sTm42VuhT25P1AM=; b=I0HQTufK4jEcyc9DavZPNAx4IvucMCKpfGJ0zcuqwf0+BJxsjii1QYVQkOm09ZkiJL mHVw9Fi/ipm0UbTezKo8BiLoiid28si7jFTTKT0gzE1kLJl7kB3AOF8LU7tWwO9GfgrD cfvfMDEEK/+j4TXstwSPdLTqUFnymfpCocozmj2hODzin77K2p1x1RR+t6NLwwhlKTLb O+W6qDQlwMI7IJH8Fk+dpjbLpTglFVyjshWXWq4I0rQ8Ioe4PTX0aAWT9RV+Ygkh2VkN wroFrY4MdprtL7KsuLrPpv+jVCkxx3LgmdkHmoUVfLwNfxKecywuAESA5G8A3DUmqye5 6GdA== 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 u24si2496344edy.585.2021.03.31.12.37.04; Wed, 31 Mar 2021 12:37:28 -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 S236210AbhCaTg2 (ORCPT + 99 others); Wed, 31 Mar 2021 15:36:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:44464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236012AbhCaTgS (ORCPT ); Wed, 31 Mar 2021 15:36:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 196426100C; Wed, 31 Mar 2021 19:36:18 +0000 (UTC) Subject: [PATCH v1 3/8] xprtrdma: Put flushed Receives on free list instead of destroying them From: Chuck Lever To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Wed, 31 Mar 2021 15:36:17 -0400 Message-ID: <161721937732.515226.2170674299158077377.stgit@manet.1015granger.net> In-Reply-To: <161721926778.515226.9805598788670386587.stgit@manet.1015granger.net> References: <161721926778.515226.9805598788670386587.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 avoid races between Receive completion and rpcrdma_reps_unmap(). Signed-off-by: Chuck Lever --- 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 1d88685badbe..92af272f9cc9 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); @@ -205,7 +207,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,