From patchwork Thu Feb 27 21:16:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D094A17E0 for ; Thu, 27 Feb 2020 21:44:15 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B86DB24690 for ; Thu, 27 Feb 2020 21:44:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B86DB24690 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 9295A349F23; Thu, 27 Feb 2020 13:35:26 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 2711921FF40 for ; Thu, 27 Feb 2020 13:21:08 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id AC2DB91BB; Thu, 27 Feb 2020 16:18:19 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id A5AB146D; Thu, 27 Feb 2020 16:18:19 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:16:53 -0500 Message-Id: <1582838290-17243-546-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 545/622] lnet: Wait for single discovery attempt of routers X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Chris Horn Historically, check_routers_before_use would cause LNet initialization to pause until all routers had been ping'd once. This behavior was changed in commit fe17e9b8370affe063769b880f02b9190584baaa from LU-11298. Now, LNet will wait indefinitely until discovery completes on all routers. This is problematic, because if even one router is down then LNet will stall forever. Introduce a new lnet_peer state to indicate whether a router has been discovered (either successfully or not) to restore the historic behavior. Fixes fe17e9b8370a ("LU-11298 lnet: use peer for gateway") Cray-bug-id: LUS-8184 WC-bug-id: https://jira.whamcloud.com/browse/LU-13001 Lustre-commit: d45a032d9a5c ("LU-13001 lnet: Wait for single discovery attempt of routers") Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/36820 Reviewed-by: Amir Shehata Reviewed-by: Neil Brown Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- include/linux/lnet/lib-types.h | 2 ++ net/lnet/lnet/router.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/lnet/lib-types.h b/include/linux/lnet/lib-types.h index 51cc9ce..4b110eb 100644 --- a/include/linux/lnet/lib-types.h +++ b/include/linux/lnet/lib-types.h @@ -732,6 +732,8 @@ struct lnet_peer { /* gw undergoing alive discovery */ #define LNET_PEER_RTR_DISCOVERY BIT(16) +/* gw has undergone discovery (does not indicate success or failure) */ +#define LNET_PEER_RTR_DISCOVERED BIT(17) struct lnet_peer_net { /* chain on lp_peer_nets */ diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c index 41d0eb0..71ba951 100644 --- a/net/lnet/lnet/router.c +++ b/net/lnet/lnet/router.c @@ -408,6 +408,7 @@ bool lnet_is_route_alive(struct lnet_route *route) spin_lock(&lp->lp_lock); lp->lp_state &= ~LNET_PEER_RTR_DISCOVERY; + lp->lp_state |= LNET_PEER_RTR_DISCOVERED; spin_unlock(&lp->lp_lock); /* Router discovery successful? All peer information would've been @@ -882,7 +883,7 @@ int lnet_get_rtr_pool_cfg(int cpt, struct lnet_ioctl_pool_cfg *pool_cfg) list_for_each_entry(rtr, &the_lnet.ln_routers, lp_rtr_list) { spin_lock(&rtr->lp_lock); - if (!(rtr->lp_state & LNET_PEER_DISCOVERED)) { + if (!(rtr->lp_state & LNET_PEER_RTR_DISCOVERED)) { all_known = 0; spin_unlock(&rtr->lp_lock); break;