Lustre-devel archive on lore.kernel.org
 help / color / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 04/22] lustre: ptlrpc: change LONG_UNLINK to PTLRPC_REQ_LONG_UNLINK
Date: Tue,  2 Jun 2020 20:59:43 -0400
Message-ID: <1591146001-27171-5-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1591146001-27171-1-git-send-email-jsimmons@infradead.org>

From: Mr NeilBrown <neilb@suse.de>

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.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10467
Lustre-commit: 7c549da4014a7 ("LU-10467 ptlrpc: change LONG_UNLINK to PTLRPC_REQ_LONG_UNLINK")
Suggested-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/38405
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/obd_support.h |  3 ++-
 fs/lustre/ptlrpc/client.c       | 13 +++++++------
 fs/lustre/ptlrpc/niobuf.c       |  7 ++++---
 fs/lustre/ptlrpc/service.c      |  2 +-
 4 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h
index ce0aa8c..b706a20 100644
--- a/fs/lustre/include/obd_support.h
+++ b/fs/lustre/include/obd_support.h
@@ -100,7 +100,8 @@
 #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 */
+/* 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/fs/lustre/ptlrpc/client.c b/fs/lustre/ptlrpc/client.c
index 4865b04..22022ff 100644
--- a/fs/lustre/ptlrpc/client.c
+++ b/fs/lustre/ptlrpc/client.c
@@ -791,11 +791,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 change the
 			 * fail_loc
@@ -2559,8 +2560,8 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
 	/* Let's setup deadline for reply unlink. */
 	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;
+		request->rq_reply_deadline = ktime_get_real_seconds() +
+					     PTLRPC_REQ_LONG_UNLINK;
 
 	/* Nothing left to do. */
 	if (!ptlrpc_client_recv_or_unlink(request))
@@ -2583,12 +2584,12 @@ 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
 		 */
-		while (seconds > LONG_UNLINK &&
+		while (seconds > PTLRPC_REQ_LONG_UNLINK &&
 		       (wait_event_idle_timeout(*wq,
 						!ptlrpc_client_recv_or_unlink(request),
 						HZ)) == 0)
diff --git a/fs/lustre/ptlrpc/niobuf.c b/fs/lustre/ptlrpc/niobuf.c
index a15c125..c59fc7f 100644
--- a/fs/lustre/ptlrpc/niobuf.c
+++ b/fs/lustre/ptlrpc/niobuf.c
@@ -253,7 +253,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 */
@@ -286,9 +287,9 @@ 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 LNDs
 		 */
-		int seconds = LONG_UNLINK;
+		int seconds = PTLRPC_REQ_LONG_UNLINK;
 
-		while (seconds > LONG_UNLINK &&
+		while (seconds > PTLRPC_REQ_LONG_UNLINK &&
 		       wait_event_idle_timeout(*wq,
 					       !ptlrpc_client_bulk_active(req),
 					       HZ) == 0)
diff --git a/fs/lustre/ptlrpc/service.c b/fs/lustre/ptlrpc/service.c
index 2f1cd35..4d5e6b3 100644
--- a/fs/lustre/ptlrpc/service.c
+++ b/fs/lustre/ptlrpc/service.c
@@ -2859,7 +2859,7 @@ static void ptlrpc_wait_replies(struct ptlrpc_service_part *svcpt)
 			 * of sluggish LNDs
 			 */
 			cnt = 0;
-			while (cnt < LONG_UNLINK &&
+			while (cnt < PTLRPC_REQ_LONG_UNLINK &&
 			       (rc = wait_event_idle_timeout(svcpt->scp_waitq,
 							     svcpt->scp_nrqbds_posted == 0,
 							     HZ)) == 0)
-- 
1.8.3.1

  parent reply index

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03  0:59 [lustre-devel] [PATCH 00/22] lustre: OpenSFS backport patches for May 29 2020 James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 01/22] lnet: libcfs: fix CPT handling for UP systems James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 02/22] lustre: use BIT() macro where appropriate in include James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 03/22] lustre: use BIT() macro where appropriate James Simmons
2020-06-03  0:59 ` James Simmons [this message]
2020-06-03  0:59 ` [lustre-devel] [PATCH 05/22] lustre: llite: use %pd to report dentry names James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 06/22] lnet: tidy lnet_discover and fix mem accounting bug James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 07/22] lustre: llite: prevent MAX_DIO_SIZE 32-bit truncation James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 08/22] lustre: llite: integrate statx() API with Lustre James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 09/22] lustre: ldlm: no current source if lu_ref_del not in same tsk James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 10/22] lnet: always pass struct lnet_md by reference James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 11/22] lustre: llite: fix read if readahead window smaller than rpc size James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 12/22] lustre: obdclass: bind zombie export cleanup workqueue James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 13/22] lnet: handle discovery off properly James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 14/22] lnet: Force full discovery cycle James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 15/22] lnet: set route aliveness properly James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 16/22] lnet: Correct the default LND timeout James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 17/22] lnet: Add lnet_lnd_timeout to sysfs James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 18/22] lnet: lnd: Allow independent ko2iblnd timeout James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 19/22] lnet: lnd: Allow independent socklnd timeout James Simmons
2020-06-03  0:59 ` [lustre-devel] [PATCH 20/22] lnet: lnd: gracefully handle unexpected events James Simmons
2020-06-03  1:00 ` [lustre-devel] [PATCH 21/22] lustre: update version to 2.13.54 James Simmons
2020-06-03  1:00 ` [lustre-devel] [PATCH 22/22] lnet: procs: print new line based on distro James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1591146001-27171-5-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Lustre-devel archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lustre-devel/0 lustre-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lustre-devel lustre-devel/ https://lore.kernel.org/lustre-devel \
		lustre-devel@lists.lustre.org
	public-inbox-index lustre-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.lustre.lists.lustre-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git