Commit 0a0e5afc authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

staging: lustre: use explicit poll loop in ptlrpc_service_unlink_rqbd

Rather an using l_wait_event(), use wait_event_idle_timeout()
with an explicit loop so it is easier to see what is happening.
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarPatrick Farrell <paf@cray.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fdeb5f9a
...@@ -2618,7 +2618,7 @@ ptlrpc_service_unlink_rqbd(struct ptlrpc_service *svc) ...@@ -2618,7 +2618,7 @@ ptlrpc_service_unlink_rqbd(struct ptlrpc_service *svc)
{ {
struct ptlrpc_service_part *svcpt; struct ptlrpc_service_part *svcpt;
struct ptlrpc_request_buffer_desc *rqbd; struct ptlrpc_request_buffer_desc *rqbd;
struct l_wait_info lwi; int cnt;
int rc; int rc;
int i; int i;
...@@ -2658,12 +2658,13 @@ ptlrpc_service_unlink_rqbd(struct ptlrpc_service *svc) ...@@ -2658,12 +2658,13 @@ ptlrpc_service_unlink_rqbd(struct ptlrpc_service *svc)
* the HUGE timeout lets us CWARN for visibility * the HUGE timeout lets us CWARN for visibility
* of sluggish LNDs * of sluggish LNDs
*/ */
lwi = LWI_TIMEOUT_INTERVAL( cnt = 0;
LONG_UNLINK * HZ, while (cnt < LONG_UNLINK &&
HZ, NULL, NULL); (rc = wait_event_idle_timeout(svcpt->scp_waitq,
rc = l_wait_event(svcpt->scp_waitq, svcpt->scp_nrqbds_posted == 0,
svcpt->scp_nrqbds_posted == 0, &lwi); HZ)) == 0)
if (rc == -ETIMEDOUT) { cnt ++;
if (rc == 0) {
CWARN("Service %s waiting for request buffers\n", CWARN("Service %s waiting for request buffers\n",
svcpt->scp_service->srv_name); svcpt->scp_service->srv_name);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment