From: James Simmons Date: Tue, 25 Feb 2020 13:41:05 +0000 (-0500) Subject: LU-10467 ptlrpc: convert waiting in ptlrpc_hr_main() X-Git-Tag: 2.13.53~175 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5891fbfad266623631e89d9f349722343592220d LU-10467 ptlrpc: convert waiting in ptlrpc_hr_main() This is a basic conditional wait. Instead of using l_wait_condition() use the linux standard wait_event_idle(). Change-Id: I5c81914de003468ac20b6c65f1b6bee2d4cf6891 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/37696 Reviewed-by: Neil Brown Tested-by: jenkins Reviewed-by: Shaun Tancheff Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/contrib/scripts/spelling.txt b/contrib/scripts/spelling.txt index 75300f0..c3488b1 100644 --- a/contrib/scripts/spelling.txt +++ b/contrib/scripts/spelling.txt @@ -144,6 +144,10 @@ LPROC_SEQ_FOPS_WR_ONLY||LUSTRE_WO_ATTR LPU64||%llu LPX64i||%llx LPX64||%#llx +l_wait_event||wait_event_idle +l_wait_event_exclusive||l_wait_event_abortable_exclusive +l_wait_event_exclusive_head||wait_event_idle_exclusive_lifo_timeout +l_wait_condition||wait_event_idle \bMAX\(||max_t \bMIN\(||min_t mdo2fid||mdd_object_fid diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 4e535f8..aa4c9b0 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -2774,7 +2774,7 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) RETURN(0); /* - * We have to l_wait_event() whatever the result, to give liblustre + * We have to wait_event_idle_timeout() whatever the result, to get * a chance to run reply_in_callback(), and to make sure we've * unlinked before returning a req to the pool. */ diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 7af98c4..82b46662 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -280,8 +280,9 @@ void ptlrpc_abort_bulk(struct ptlrpc_bulk_desc *desc) /* The unlink ensures the callback happens ASAP and is the last * one. If it fails, it must be because completion just happened, - * but we must still l_wait_event() in this case, to give liblustre - * a chance to run server_bulk_callback()*/ + * but we must still wait_event_idle_timeout() in this case, to give + * us a chance to run server_bulk_callback() + */ mdunlink_iterate_helper(desc->bd_mds, desc->bd_md_max_brw); for (;;) { @@ -452,8 +453,9 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async) /* the unlink ensures the callback happens ASAP and is the last * one. If it fails, it must be because completion just happened, - * but we must still l_wait_event() in this case to give liblustre - * a chance to run client_bulk_callback() */ + * but we must still wait_event_idle_timeout() in this case to give + * us a chance to run client_bulk_callback() + */ mdunlink_iterate_helper(desc->bd_mds, desc->bd_md_max_brw); if (ptlrpc_client_bulk_active(req) == 0) /* completed or */ diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index a0eb608..be5df0d 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -2980,7 +2980,7 @@ static int ptlrpc_hr_main(void *arg) wake_up(&ptlrpc_hr.hr_waitq); while (!ptlrpc_hr.hr_stopping) { - l_wait_condition(hrt->hrt_waitq, hrt_dont_sleep(hrt, &replies)); + wait_event_idle(hrt->hrt_waitq, hrt_dont_sleep(hrt, &replies)); while (!list_empty(&replies)) { struct ptlrpc_reply_state *rs;