Whamcloud - gitweb
LU-10467 ptlrpc: change LONG_UNLINK to PTLRPC_REQ_LONG_UNLINK 05/38405/3
authorMr NeilBrown <neilb@suse.de>
Tue, 28 Apr 2020 23:39:26 +0000 (09:39 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 May 2020 05:04:00 +0000 (05:04 +0000)
The name "LONG_UNLINK" is vague and generic.  Change it to
  PTLRPC_REQ_LONG_UNLINK
to make it clear it is about requests taking a long time,
and of interest to PTLRPC.

Test-Parameters: trivial
Suggested-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I990657da3ec780c982a7ae31c21e4c8c9064be17
Reviewed-on: https://review.whamcloud.com/38405
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/include/obd_support.h
lustre/ptlrpc/client.c
lustre/ptlrpc/niobuf.c
lustre/ptlrpc/service.c

index 5130ca0..57ec62f 100644 (file)
@@ -127,13 +127,14 @@ extern char obd_jobid_var[];
 #define RECONNECT_DELAY_MAX (CONNECTION_SWITCH_MAX + CONNECTION_SWITCH_INC + \
                              INITIAL_CONNECT_TIMEOUT)
 /* The min time a target should wait for clients to reconnect in recovery */
-#define OBD_RECOVERY_TIME_MIN    (2*RECONNECT_DELAY_MAX)
-#define OBD_IR_FACTOR_MIN         1
-#define OBD_IR_FACTOR_MAX         10
-#define OBD_IR_FACTOR_DEFAULT    (OBD_IR_FACTOR_MAX/2)
+#define OBD_RECOVERY_TIME_MIN  (2*RECONNECT_DELAY_MAX)
+#define OBD_IR_FACTOR_MIN      1
+#define OBD_IR_FACTOR_MAX      10
+#define OBD_IR_FACTOR_DEFAULT  (OBD_IR_FACTOR_MAX/2)
 /* default timeout for the MGS to become IR_FULL */
-#define OBD_IR_MGS_TIMEOUT       (4*obd_timeout)
-#define LONG_UNLINK 300          /* Unlink should happen before now */
+#define OBD_IR_MGS_TIMEOUT     (4*obd_timeout)
+/* Unlink should happen within this many seconds. */
+#define PTLRPC_REQ_LONG_UNLINK 300
 
 /**
  * Time interval of shrink, if the client is "idle" more than this interval,
index f113b2e..254852d 100644 (file)
@@ -829,11 +829,12 @@ int ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
                }
 
                if (fail_t) {
-                       *fail_t = ktime_get_real_seconds() + LONG_UNLINK;
+                       *fail_t = ktime_get_real_seconds() +
+                                 PTLRPC_REQ_LONG_UNLINK;
 
                        if (fail2_t)
                                *fail2_t = ktime_get_real_seconds() +
-                                          LONG_UNLINK;
+                                          PTLRPC_REQ_LONG_UNLINK;
 
                        /*
                         * The RPC is infected, let the test to change the
@@ -2723,7 +2724,7 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK) &&
            async && request->rq_reply_deadline == 0 && cfs_fail_val == 0)
                request->rq_reply_deadline = ktime_get_real_seconds() +
-                                            LONG_UNLINK;
+                                            PTLRPC_REQ_LONG_UNLINK;
 
        /*
         * Nothing left to do.
@@ -2757,7 +2758,7 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
                wait_queue_head_t *wq = (request->rq_set) ?
                                        &request->rq_set->set_waitq :
                                        &request->rq_reply_waitq;
-               int seconds = LONG_UNLINK;
+               int seconds = PTLRPC_REQ_LONG_UNLINK;
                /*
                 * Network access will complete in finite time but the HUGE
                 * timeout lets us CWARN for visibility of sluggish NALs
index 41badd7..a89b526 100644 (file)
@@ -292,7 +292,7 @@ void ptlrpc_abort_bulk(struct ptlrpc_bulk_desc *desc)
        for (;;) {
                /* Network access will complete in finite time but the HUGE
                 * timeout lets us CWARN for visibility of sluggish NALs */
-               int seconds = LONG_UNLINK;
+               int seconds = PTLRPC_REQ_LONG_UNLINK;
 
                while (seconds > 0 &&
                       wait_event_idle_timeout(desc->bd_waitq,
@@ -449,7 +449,8 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
        /* Let's setup deadline for reply unlink. */
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_BULK_UNLINK) &&
            async && req->rq_bulk_deadline == 0 && cfs_fail_val == 0)
-               req->rq_bulk_deadline = ktime_get_real_seconds() + LONG_UNLINK;
+               req->rq_bulk_deadline = ktime_get_real_seconds() +
+                                       PTLRPC_REQ_LONG_UNLINK;
 
        if (ptlrpc_client_bulk_active(req) == 0)        /* completed or */
                RETURN(1);                              /* never registered */
@@ -482,7 +483,7 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
                 * Network access will complete in finite time but the HUGE
                 * timeout lets us CWARN for visibility of sluggish NALs.
                 */
-               int seconds = LONG_UNLINK;
+               int seconds = PTLRPC_REQ_LONG_UNLINK;
 
                while (seconds > 0 &&
                       wait_event_idle_timeout(*wq,
index f5d11fd..da4899a 100644 (file)
@@ -3427,7 +3427,7 @@ ptlrpc_service_unlink_rqbd(struct ptlrpc_service *svc)
                 */
                spin_lock(&svcpt->scp_lock);
                while (svcpt->scp_nrqbds_posted != 0) {
-                       int seconds = LONG_UNLINK;
+                       int seconds = PTLRPC_REQ_LONG_UNLINK;
 
                        spin_unlock(&svcpt->scp_lock);
                        /*