Whamcloud - gitweb
LU-10467 ptlrpc: convert waiting in ptlrpc_hr_main() 96/37696/4
authorJames Simmons <jsimmons@infradead.org>
Tue, 25 Feb 2020 13:41:05 +0000 (08:41 -0500)
committerOleg Drokin <green@whamcloud.com>
Sun, 1 Mar 2020 05:35:15 +0000 (05:35 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37696
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
contrib/scripts/spelling.txt
lustre/ptlrpc/client.c
lustre/ptlrpc/niobuf.c
lustre/ptlrpc/service.c

index 75300f0..c3488b1 100644 (file)
@@ -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
index 4e535f8..aa4c9b0 100644 (file)
@@ -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.
         */
index 7af98c4..82b4666 100644 (file)
@@ -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 */
index a0eb608..be5df0d 100644 (file)
@@ -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;