From 7c549da4014a7c7f7f662876115db16f4b05d74c Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Wed, 29 Apr 2020 09:39:26 +1000 Subject: [PATCH] LU-10467 ptlrpc: change LONG_UNLINK to PTLRPC_REQ_LONG_UNLINK 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 Signed-off-by: Mr NeilBrown Change-Id: I990657da3ec780c982a7ae31c21e4c8c9064be17 Reviewed-on: https://review.whamcloud.com/38405 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons --- lustre/include/obd_support.h | 13 +++++++------ lustre/ptlrpc/client.c | 9 +++++---- lustre/ptlrpc/niobuf.c | 7 ++++--- lustre/ptlrpc/service.c | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 5130ca0..57ec62f 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -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, diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index f113b2e..254852d 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -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 diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 41badd7..a89b526 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -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, diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index f5d11fd..da4899a 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -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); /* -- 1.8.3.1