Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2056903ybt; Sun, 21 Jun 2020 07:53:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywYl7226Pi8hpHqUzcta/zqfOLKbir7kuFnT77DSMkzwD9EI/nlJtqzA7SWSMralov6MRr X-Received: by 2002:a05:6402:6d6:: with SMTP id n22mr13229579edy.362.1592751190145; Sun, 21 Jun 2020 07:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592751190; cv=none; d=google.com; s=arc-20160816; b=pWsEGqFh+N6OBwlqGjsyac3uIaE5PXIB1+d4otiKS2KGQEZgyVQ8XxTAMbbtZnDpBu 8l5fsIfbtRcmYbUPzr33/RTFMZLJZZrdFgL+9ENtxADPKIGBuiywMPeoivZXPTyjg7YJ zbgn/FhIjkAZSpikLTxcIJCcBtazKjkExjxpwPhN7Jsw8J0aPbYPhyfTEqB/WV9rtL8q hzHCRlv67YwKA58IuesbO5XvHhnrYx99Vh/PInbzKwtSA/1ccVRWpJu1wF++3DdcNwdJ IyB0FWnbiN3wOoXj/srm7GiPZ1h0eofc1yttxhXDcMYIq+FMqfd/VraBABsTv5mosGqN eKWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=Y7sgi1rG1TMQ3ENdfaLCduZHCD4ouSfcPchsLjVziHk=; b=TWHyuPkngD6bcShlY5ljP/eaqu2G8hxm/n5v2O0G1DV2TWp8zhce8ZJjDlmIQ9GTL8 n7ROWmSa4Gbt8rchJasknCMUv8TrUhYntbEbHrDWui7o68gi0jEA7tSUZr/mWMeORLFb DaUbj38NFqtydLH9lgulmzpmqBQGXt7BZS/i2UPZMMPGXcz2IpU0tYbzdZYieK7fOLyf 3qyAgjYW37Pf4mmi3we919sYHNDZvA+9CPKUTbUh3KZcOqR84yaIDAfv8ItRxkT3rtzf V9z54Nfmr0cN8HkBV246LBHrb4K1Kzm90oG9C9sCSAUlfmk/lDxA0tibLOmtWP0Yxu9/ T08A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=P9O2azF7; 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=pass (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 h10si7189619eja.608.2020.06.21.07.52.32; Sun, 21 Jun 2020 07:53:10 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=P9O2azF7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730201AbgFUOv7 (ORCPT + 99 others); Sun, 21 Jun 2020 10:51:59 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:58264 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730183AbgFUOv7 (ORCPT ); Sun, 21 Jun 2020 10:51:59 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05LEgbww141719; Sun, 21 Jun 2020 14:51:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2020-01-29; bh=Y7sgi1rG1TMQ3ENdfaLCduZHCD4ouSfcPchsLjVziHk=; b=P9O2azF7o5ZdV2/8XleN/ahKyy5rKl4PcpOGzHScI9j+CjZcLcrIeXF6ksxPJGm5I30Q mFe6URmvBQAmRZquMRmxX9tAnZy05ui97K2K7cum0Z8jqWTGPTxwlwwDFIhjgYklS9yY EApYeNJpYVPNtmrvPS9TF8htoj3SIOr3+o2OCDAu4x1xfKBvoY5mTkN50c+mJoF+j89v OllfpnBFCMKUtbBtN/hsoL1wOHDXoPzish688R9EfzjsyY0F8Liu17+fGhZotZtRqQMK jeCgvNBFYKj3Pm6xXk9lj7HqfRIivDIF5almTrmasrzj2yyzqy7yl6ysKEHyTRdNY/Oz Qw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 31sebbb18y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 21 Jun 2020 14:51:56 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05LEmsFe078644; Sun, 21 Jun 2020 14:49:56 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 31svctpst1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 21 Jun 2020 14:49:56 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 05LEntSD011505; Sun, 21 Jun 2020 14:49:55 GMT Received: from anon-dhcp-153.1015granger.net (/68.61.232.219) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 21 Jun 2020 14:49:55 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: [PATCH] xprtrdma: Wake up re_connect_wait on disconnect From: Chuck Lever In-Reply-To: Date: Sun, 21 Jun 2020 10:49:53 -0400 Cc: linux-rdma@vger.kernel.org, Linux NFS Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: References: <20200620171805.1748399-1-dan@kernelim.com> To: Dan Aloni X-Mailer: Apple Mail (2.3445.104.14) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9659 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 adultscore=0 malwarescore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006210118 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9659 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 cotscore=-2147483648 mlxscore=0 phishscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 suspectscore=0 clxscore=1015 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006210117 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Dan- > On Jun 20, 2020, at 2:46 PM, Chuck Lever = wrote: >=20 > Hi Dan- >=20 >> On Jun 20, 2020, at 1:18 PM, Dan Aloni wrote: >>=20 >> Given that rpcrdma_xprt_connect() happens from workqueue context, on = cases where >> connections don't succeeds, something needs to wake it up. In my = case, this has >> been observed when the CM callback received `RDMA_CM_EVENT_REJECTED`, = and >> `rpcrdma_xprt_connect()` slept forever. >=20 > Interesting. My development and testing generates plenty of REJECTED = connection > requests, but I never saw this particular failure mode. Correction: My testing _used_ _to_ generate REJECTED events regularly. = It does not seem to any more, even after client crashes. So that explains why I = haven't seen this before. I haven't reproduced the problem here, but the fix still looks proper to = me, and doesn't appear to introduce any regressions. I do have some issues = with your proposed patch, though. The first paragraph of the patch description is incorrect. = RDMA_CM_EVENT_DISCONNECTED can occur only once a connection has been established. That guarantees = there are no waiters on re_connect_wait in that case. It's connect errors that need = to wake-up the connect worker. >> This continues the fix in commit 58bd6656f808 ('xprtrdma: Restore = wake-up-all to >> rpcrdma_cm_event_handler()'). IMO this paragraph needs to be replaced by: Fixes: e28ce90083f0 ("xprtrdma: kmalloc rpcrdma_ep separate from = rpcrdma_xprt") >> Signed-off-by: Dan Aloni >> CC: Chuck Lever >> --- >>=20 >> Notes: >> Hi Chuck, >>=20 >> Maybe I missd something, as it is not clear to me how otherwise = (without this >> patch), re_connect_wait can be woken up in this situation. Please = explain? >>=20 >> net/sunrpc/xprtrdma/verbs.c | 1 + >> 1 file changed, 1 insertion(+) >>=20 >> diff --git a/net/sunrpc/xprtrdma/verbs.c = b/net/sunrpc/xprtrdma/verbs.c >> index 2ae348377806..8bd76a47a91f 100644 >> --- a/net/sunrpc/xprtrdma/verbs.c >> +++ b/net/sunrpc/xprtrdma/verbs.c >> @@ -289,6 +289,7 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, = struct rdma_cm_event *event) >> ep->re_connect_status =3D -ECONNABORTED; >> disconnected: >> xprt_force_disconnect(xprt); >> + wake_up_all(&ep->re_connect_wait); >> return rpcrdma_ep_destroy(ep); >> default: >> break; This hunk does not apply on top of fixes I've already sent to Anna for = 5.8-rc1. So, if you don't object, I'll adjust your patch (this hunk and the = description) before sending it along to Anna. -- Chuck Lever