Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp719009pxf; Wed, 31 Mar 2021 14:26:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEs8CGP3HYr0x/C0RaPMIGaasSSaW+Gfl/RhSbfluHX+M11bolL4s/GPqixcghFy5vSbz3 X-Received: by 2002:a17:906:af91:: with SMTP id mj17mr5648701ejb.230.1617226006795; Wed, 31 Mar 2021 14:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617226006; cv=none; d=google.com; s=arc-20160816; b=PbnPxf5Vm+DqXNKgWJPC/gj3b/zf6pH3h4Fw2UIVI7gazlgYfGZ6sN26m7MIWJZLV/ 2Cwlnx0XisFiVqR6NAzr+ef0r5gluZ6xobw9V6GLqtY4kDQ+OKmtWCGNM8FZzhzt0VQ/ xLwxm0pIezwMFu+rMAXVyetuVVRqLu9vDYz4fF2xkwlZ2Z9c0Xpcx1Ot/4GeGKjAXbx/ uBloM7Hce+canLggsZlyozgu4zdVERZHinPo/tQ1Mxp/LZTJ9nEW3VP+69K16nh/1DDp 8QFV+aX6i6vC5GX1HajZ5y0OoI4NULE3GFt/Bebscr73rejBJt21k6o6IlPuqSQ0gf0d AeXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Z5prhIaAqMy0IW6lr61kCOAS2Yj7yajciDjcJYbib0M=; b=rJ17MBpJTh2D2Jpm8zywt/bTdzcahOPpNSCpidoKJDQYxd5JBJsZ3dF6EamG3w4jCf ygcKH8bDNNnU8hg4k+r/ebf7RJbQD26/Xp+8sQCOw47996VlfLKFIVJEIs9Tnh9jxT99 5ofGPnK+w9jSWZmDiwuLDJ9SUgm0+Mp8M7XEsk1iInxcmNZZ52xPJrkB3nt9342OIMji FB96O3jmw7gIKTxZseY7014DfuxsFMG0ajVmUEF7LPM6h0080Jy1fxksX3XbK1X3vea3 9ID4rnw20FhP4wJppdv4GKVYM+pw+pbenFSGgavBKMoG9nq5ubzvgOwjZBoFYHb6ib89 L9WQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si3141949edc.150.2021.03.31.14.26.18; Wed, 31 Mar 2021 14:26:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231156AbhCaVXJ (ORCPT + 99 others); Wed, 31 Mar 2021 17:23:09 -0400 Received: from p3plsmtpa06-07.prod.phx3.secureserver.net ([173.201.192.108]:47699 "EHLO p3plsmtpa06-07.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231339AbhCaVW5 (ORCPT ); Wed, 31 Mar 2021 17:22:57 -0400 Received: from [192.168.0.116] ([71.184.94.153]) by :SMTPAUTH: with ESMTPSA id RiIhlXwX4ZK7ARiIilj9u1; Wed, 31 Mar 2021 14:22:56 -0700 X-CMAE-Analysis: v=2.4 cv=INzHtijG c=1 sm=1 tr=0 ts=6064e830 a=vbvdVb1zh1xTTaY8rfQfKQ==:117 a=vbvdVb1zh1xTTaY8rfQfKQ==:17 a=IkcTkHD0fZMA:10 a=SEc3moZ4AAAA:8 a=awFB1WZmbsX3KXInVVwA:9 a=QEXdDO2ut3YA:10 a=5oRCH6oROnRZc2VpWJZ3:22 X-SECURESERVER-ACCT: tom@talpey.com Subject: Re: [PATCH v1 2/8] xprtrdma: Do not post Receives after disconnect To: chucklever@gmail.com Cc: linux-rdma , Linux NFS Mailing List References: <161721926778.515226.9805598788670386587.stgit@manet.1015granger.net> <161721937122.515226.14731175629421422152.stgit@manet.1015granger.net> <4004f56f-3603-f56c-aea9-651230b3181e@talpey.com> From: Tom Talpey Message-ID: Date: Wed, 31 Mar 2021 17:22:56 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfGspgVnBWKLRfg0RYXEUikZLTzvE4aYAsKRpVwhOGl8bNfKejLh+7SjcJrHBxDob0m1eO+AiQemHn1tWlASv+2VSsQUO23mgnb2PPA7K2pRgpoLLvyMP vGwSJcRE534bMU91+BWzVGrFOzGrkKKm4Io1jM1LY6F5kKeuhEQW43UmkMfrgJ+vN/lfBN5ioW2w9Q+dCAUekVyz/zhNuWydNnz0687rMvne2wPmSppmtT39 5iBO44fbQaxpq8AQO2W2stnofppnYDzNDgjP8+Ms/XU= Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 3/31/2021 4:31 PM, Chuck Lever wrote: > On Wed, Mar 31, 2021 at 4:01 PM Tom Talpey wrote: >> >> On 3/31/2021 3:36 PM, Chuck Lever wrote: >>> Currently the Receive completion handler refreshes the Receive Queue >>> whenever a successful Receive completion occurs. >>> >>> On disconnect, xprtrdma drains the Receive Queue. The first few >>> Receive completions after a disconnect are typically successful, >>> until the first flushed Receive. snip >> Is it not possible to mark the WRs as >> being part of a batch, and allowing them to flush? You could borrow a >> bit in the completion cookie, and check it when the CQE pops out. Maybe. > > It's not an issue with batching, it's an issue with posting Receives from the > Receive completion handler. I'd think that any of the ULPs that post Receives > in their completion handler would have the same issue. > > The purpose of the QP drain in rpcrdma_xprt_disconnect() is to ensure there > are no more WRs in flight so that the hardware resources can be safely > destroyed. If the Receive completion handler continues to post Receive WRs > after the drain sentinel has been posted, leaks and crashes become possible. Well, why not do an atomic_set() of a flag just before posting the sentinel, and check it with atomic_get() before any other RQ post? Tom.