From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBotxNjH3jmIviw20ySUeEvc2Y/7t/+MYL0WkkIfVCxDnTrmXpzChhPvs1JP9MMJ59UTrlJsW ARC-Seal: i=1; a=rsa-sha256; t=1516203343; cv=none; d=google.com; s=arc-20160816; b=e49Hgs1/vfkb1xpN8l4JqiQ3+yJJweuhD6VIziRSbuDqXaG0cRsFf3tl6wwxH+pzyS BRG1TMkRGTw1YwOf+KErn6npN/RxLisNXGWucK4euWP6reI2khX/aNyEqE3vD+EX9hdI ffYyOr6h0ZOLNh/007lHKr7IGJ2wQzvmT9lyuxLwu3MXlvDVBN6cRW5WCN+165nA60dA P7gLXq1M1vehMbxejgp0aY2HtPmEBO/MtgBQxVySuPdr+ArJ9ZyIsfUsqUZ1yG/yU3lv g7pC8qSaq427KAD2XkGo2gVYl1ge/I8KnN7Q9sUJd+/ldVNFUF/CpE2Q30fZf1g24fxb M3Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:dkim-signature:arc-authentication-results; bh=nAkCONXmBnXTTdcGA1AFHyfLbrgyZ5PQWLTYuA1VoWU=; b=LZMAqhVrWmLL0dvn/VeVbMkiS4fJa84sWxqSM/h6ON6gPJZB1iIozFBzS+6too/Nop 4pNjhvWEm22bApr02U9JiX73vx5W80ZoiMEq9zShbq68Axbl+7dbCk/jjwvraAoNWn2B 4fvD7ew9kRRe0gQFmgvfukJ4hg7FSMTR98N3/L/KL8knqY1szguIrW8I3J2GS4+7VOdl 1Bg7Qj5xsLVlD0sV4zSCidHw7jgb6G0LN2ipm6qspVzZVnSv/sAj+iyOqwc6q7DS7u3+ WD0b5LoOxz7jj1fm0+9yLjEFp47XB1lWqYlkPh78QJu1fY2LfXoBzJ981LT/eDeZ1o2B 9/+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KogYu8ap; spf=pass (google.com: best guess record for domain of jsimmons@infradead.org designates 2001:8b0:10b:1236::1 as permitted sender) smtp.mailfrom=jsimmons@infradead.org Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KogYu8ap; spf=pass (google.com: best guess record for domain of jsimmons@infradead.org designates 2001:8b0:10b:1236::1 as permitted sender) smtp.mailfrom=jsimmons@infradead.org Date: Wed, 17 Jan 2018 15:35:39 +0000 (GMT) From: James Simmons To: NeilBrown cc: Oleg Drokin , Andreas Dilger , Greg Kroah-Hartman , lkml , lustre Subject: Re: [PATCH 16/19] staging: lustre: use explicit poll loop in ptlrpc_unregister_reply In-Reply-To: <151538209390.23920.11839113414532003231.stgit@noble> Message-ID: References: <151538168618.23920.8261096424342988792.stgit@noble> <151538209390.23920.11839113414532003231.stgit@noble> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180117_153539_684953_0EC78F05 X-CRM114-Status: GOOD ( 11.32 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1588993478205680228?= X-GMAIL-MSGID: =?utf-8?q?1589854437102750179?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: > replace l_wait_event() with wait_event_idle_timeout() and explicit > loop. This approach is easier to understand. Reviewed-by: James Simmons > Signed-off-by: NeilBrown > --- > drivers/staging/lustre/lustre/ptlrpc/client.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c > index f70176c6db08..ffdd3ffd62c6 100644 > --- a/drivers/staging/lustre/lustre/ptlrpc/client.c > +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c > @@ -2500,7 +2500,6 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) > { > int rc; > wait_queue_head_t *wq; > - struct l_wait_info lwi; > > /* Might sleep. */ > LASSERT(!in_interrupt()); > @@ -2543,16 +2542,17 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) > * Network access will complete in finite time but the HUGE > * timeout lets us CWARN for visibility of sluggish NALs > */ > - lwi = LWI_TIMEOUT_INTERVAL(LONG_UNLINK * HZ, > - HZ, NULL, NULL); > - rc = l_wait_event(*wq, !ptlrpc_client_recv_or_unlink(request), > - &lwi); > - if (rc == 0) { > + int cnt = 0; > + while (cnt < LONG_UNLINK && > + (rc = wait_event_idle_timeout(*wq, > + !ptlrpc_client_recv_or_unlink(request), > + HZ)) == 0) > + cnt += 1; > + if (rc > 0) { > ptlrpc_rqphase_move(request, request->rq_next_phase); > return 1; > } > > - LASSERT(rc == -ETIMEDOUT); > DEBUG_REQ(D_WARNING, request, > "Unexpectedly long timeout receiving_reply=%d req_ulinked=%d reply_unlinked=%d", > request->rq_receiving_reply, > > >