X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fptlrpc%2Fservice.c;h=6278f7b5d37bd5b69326683738132738b45b85b0;hp=2f0f3a59db360c099cab831db06c3b2948d2b5cb;hb=468c7759dd73594065dc029eeb73c514d589db3a;hpb=cda0fa2a7bb0cadaedc526a7d4e2f3d9fb3c1319 diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 2f0f3a5..6278f7b 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -3158,23 +3158,24 @@ EXPORT_SYMBOL(ptlrpc_unregister_service); * to be shot, so it's intentionally non-aggressive. */ int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt) { - struct ptlrpc_request *request; + struct ptlrpc_request *request = NULL; struct timeval right_now; long timediff; cfs_gettimeofday(&right_now); spin_lock(&svcpt->scp_req_lock); - if (!ptlrpc_server_request_pending(svcpt, 1)) { + /* How long has the next entry been waiting? */ + if (ptlrpc_server_high_pending(svcpt, 1)) + request = ptlrpc_nrs_req_poll_nolock(svcpt, true); + else if (ptlrpc_server_normal_pending(svcpt, 1)) + request = ptlrpc_nrs_req_poll_nolock(svcpt, false); + + if (request == NULL) { spin_unlock(&svcpt->scp_req_lock); return 0; } - /* How long has the next entry been waiting? */ - request = ptlrpc_nrs_req_poll_nolock(svcpt, true); - if (request == NULL) - request = ptlrpc_nrs_req_poll_nolock(svcpt, false); - timediff = cfs_timeval_sub(&right_now, &request->rq_arrival_time, NULL); spin_unlock(&svcpt->scp_req_lock);