From 0b1947d14188db34de0aa12b8d21e0b09e00ae13 Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Mon, 13 Aug 2018 16:19:00 -0700 Subject: [PATCH] LU-9120 lnet: remove duplicate timeout mechanism Remove the duplicate GET/PUT timeout mechanism currently implemented for discovery, as it has been replaced by a more generic timeout mechanism for all GET/PUT messages. Test-Parameters: forbuildonly Signed-off-by: Amir Shehata Change-Id: I28efae8c1fca6fc07fcaad4bfacf123b00ff887d Reviewed-on: https://review.whamcloud.com/32992 Reviewed-by: Sonia Sharma Reviewed-by: Olaf Weber Tested-by: Jenkins --- lnet/lnet/peer.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index b20f8ed..bda87c5 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -2935,25 +2935,6 @@ __must_hold(&lp->lp_lock) } /* - * Returns the first peer on the ln_dc_working queue if its timeout - * has expired. Takes the current time as an argument so as to not - * obsessively re-check the clock. The oldest discovery request will - * be at the head of the queue. - */ -static struct lnet_peer *lnet_peer_get_dc_timed_out(time64_t now) -{ - struct lnet_peer *lp; - - if (list_empty(&the_lnet.ln_dc_working)) - return NULL; - lp = list_first_entry(&the_lnet.ln_dc_working, - struct lnet_peer, lp_dc_list); - if (now < lp->lp_last_queued + lnet_transaction_timeout) - return NULL; - return lp; -} - -/* * Discovering this peer is taking too long. Cancel any Ping or Push * that discovery is waiting on by unlinking the relevant MDs. The * lnet_discovery_event_handler() will proceed from here and complete @@ -3008,8 +2989,6 @@ static int lnet_peer_discovery_wait_for_work(void) break; if (!list_empty(&the_lnet.ln_msg_resend)) break; - if (lnet_peer_get_dc_timed_out(ktime_get_real_seconds())) - break; lnet_net_unlock(cpt); /* @@ -3079,7 +3058,6 @@ static void lnet_resend_msgs(void) static int lnet_peer_discovery(void *arg) { struct lnet_peer *lp; - time64_t now; int rc; CDEBUG(D_NET, "started\n"); @@ -3171,23 +3149,6 @@ static int lnet_peer_discovery(void *arg) break; } - /* - * Now that the ln_dc_request queue has been emptied - * check the ln_dc_working queue for peers that are - * taking too long. Move all that are found to the - * ln_dc_expired queue and time out any pending - * Ping or Push. We have to drop the lnet_net_lock - * in the loop because lnet_peer_cancel_discovery() - * calls LNetMDUnlink(). - */ - now = ktime_get_real_seconds(); - while ((lp = lnet_peer_get_dc_timed_out(now)) != NULL) { - list_move(&lp->lp_dc_list, &the_lnet.ln_dc_expired); - lnet_net_unlock(LNET_LOCK_EX); - lnet_peer_cancel_discovery(lp); - lnet_net_lock(LNET_LOCK_EX); - } - lnet_net_unlock(LNET_LOCK_EX); } -- 1.8.3.1