lustre-devel-lustre.org archive mirror
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Andreas Dilger <adilger@whamcloud.com>,
	Oleg Drokin <green@whamcloud.com>, NeilBrown <neilb@suse.de>
Cc: Alexander Boyko <alexander.boyko@hpe.com>,
	Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [lustre-devel] [PATCH 21/24] lustre: ptlrpc: adds configurable ping interval
Date: Sun, 18 Sep 2022 01:22:11 -0400	[thread overview]
Message-ID: <1663478534-19917-22-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1663478534-19917-1-git-send-email-jsimmons@infradead.org>

From: Alexander Boyko <alexander.boyko@hpe.com>

The patch adds ability to change ping interval and eviction
mutliplier. A default values stay as before.
Example
lctl set_param ping_interval=10
lctl set_param evict_multiplier=5

HPE-bug-id: LUS-11054
WC-bug-id: https://jira.whamcloud.com/browse/LU-16002
Lustre-commit: 8e66f061c01e53cda ("LU-16002 ptlrpc: adds configurable ping interval")
Signed-off-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-on: https://review.whamcloud.com/47982
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/obd_support.h |  6 ++++--
 fs/lustre/obdclass/class_obd.c  |  5 +++++
 fs/lustre/obdclass/obd_config.c |  1 +
 fs/lustre/obdclass/obd_sysfs.c  | 32 ++++++++++++++++++++++++++++++--
 4 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h
index c98c8a4..b58c1df 100644
--- a/fs/lustre/include/obd_support.h
+++ b/fs/lustre/include/obd_support.h
@@ -47,6 +47,8 @@
  * networking / disk / timings affected by load (use Adaptive Timeouts)
  */
 extern unsigned int obd_timeout;	/* seconds */
+extern unsigned int ping_interval;	/* seconds */
+extern unsigned int ping_evict_timeout_multiplier;
 extern unsigned int obd_timeout_set;
 extern unsigned int at_min;
 extern unsigned int at_max;
@@ -66,7 +68,7 @@
 /* Should be very conservative; must catch the first reconnect after reboot */
 #define OBD_RECOVERY_TIME_SOFT	(obd_timeout * 3)
 /* Change recovery-small 26b time if you change this */
-#define PING_INTERVAL		max(obd_timeout / 4, 1U)
+#define PING_INTERVAL		ping_interval
 /* a bit more than maximal journal commit time in seconds */
 #define PING_INTERVAL_SHORT	min(PING_INTERVAL, 7U)
 /* Client may skip 1 ping; we must wait at least 2.5. But for multiple
@@ -75,7 +77,7 @@
  * and there's no urgent need to evict a client just because it's idle, we
  * should be very conservative here.
  */
-#define PING_EVICT_TIMEOUT	(PING_INTERVAL * 6)
+#define PING_EVICT_TIMEOUT	(PING_INTERVAL * ping_evict_timeout_multiplier)
 #define DISK_TIMEOUT		50 /* Beyond this we warn about disk speed */
 #define CONNECTION_SWITCH_MIN	5U /* Connection switching rate limiter */
 /* Max connect interval for nonresponsive servers; ~50s to avoid building up
diff --git a/fs/lustre/obdclass/class_obd.c b/fs/lustre/obdclass/class_obd.c
index b30d941..f455ed7 100644
--- a/fs/lustre/obdclass/class_obd.c
+++ b/fs/lustre/obdclass/class_obd.c
@@ -63,6 +63,11 @@
 EXPORT_SYMBOL(obd_dirty_pages);
 unsigned int obd_timeout = OBD_TIMEOUT_DEFAULT;   /* seconds */
 EXPORT_SYMBOL(obd_timeout);
+unsigned int ping_interval = (OBD_TIMEOUT_DEFAULT > 4) ?
+			     (OBD_TIMEOUT_DEFAULT / 4) : 1;
+EXPORT_SYMBOL(ping_interval);
+unsigned int ping_evict_timeout_multiplier = 6;
+EXPORT_SYMBOL(ping_evict_timeout_multiplier);
 unsigned int obd_timeout_set;
 EXPORT_SYMBOL(obd_timeout_set);
 /* Adaptive timeout defs here instead of ptlrpc module for /sys/fs/ access */
diff --git a/fs/lustre/obdclass/obd_config.c b/fs/lustre/obdclass/obd_config.c
index 4db7399..7d001ff 100644
--- a/fs/lustre/obdclass/obd_config.c
+++ b/fs/lustre/obdclass/obd_config.c
@@ -869,6 +869,7 @@ int class_process_config(struct lustre_cfg *lcfg)
 		CDEBUG(D_IOCTL, "changing lustre timeout from %d to %d\n",
 		       obd_timeout, lcfg->lcfg_num);
 		obd_timeout = max(lcfg->lcfg_num, 1U);
+		ping_interval = max(obd_timeout / 4, 1U);
 		obd_timeout_set = 1;
 		err = 0;
 		goto out;
diff --git a/fs/lustre/obdclass/obd_sysfs.c b/fs/lustre/obdclass/obd_sysfs.c
index 93d2abc..fc8debb 100644
--- a/fs/lustre/obdclass/obd_sysfs.c
+++ b/fs/lustre/obdclass/obd_sysfs.c
@@ -109,7 +109,6 @@ static ssize_t static_uintvalue_store(struct kobject *kobj,
 	{ __ATTR(name, 0644, static_uintvalue_show,			\
 		 static_uintvalue_store), value }
 
-LUSTRE_STATIC_UINT_ATTR(timeout, &obd_timeout);
 LUSTRE_STATIC_UINT_ATTR(debug_peer_on_timeout, &obd_debug_peer_on_timeout);
 LUSTRE_STATIC_UINT_ATTR(dump_on_timeout, &obd_dump_on_timeout);
 LUSTRE_STATIC_UINT_ATTR(dump_on_eviction, &obd_dump_on_eviction);
@@ -119,6 +118,8 @@ static ssize_t static_uintvalue_store(struct kobject *kobj,
 LUSTRE_STATIC_UINT_ATTR(at_early_margin, &at_early_margin);
 LUSTRE_STATIC_UINT_ATTR(at_history, &at_history);
 LUSTRE_STATIC_UINT_ATTR(lbug_on_eviction, &obd_lbug_on_eviction);
+LUSTRE_STATIC_UINT_ATTR(ping_interval, &ping_interval);
+LUSTRE_STATIC_UINT_ATTR(evict_multiplier, &ping_evict_timeout_multiplier);
 
 static ssize_t max_dirty_mb_show(struct kobject *kobj, struct attribute *attr,
 				 char *buf)
@@ -311,6 +312,30 @@ static ssize_t jobid_this_session_store(struct kobject *kobj,
 	return ret ?: count;
 }
 
+static ssize_t timeout_show(struct kobject *kobj,
+			    struct attribute *attr,
+			    char *buf)
+{
+	return sprintf(buf, "%u\n", obd_timeout);
+}
+
+static ssize_t timeout_store(struct kobject *kobj,
+			     struct attribute *attr,
+			     const char *buffer,
+			     size_t count)
+{
+	unsigned int val;
+	int rc;
+
+	rc = kstrtouint(buffer, 10, &val);
+	if (rc)
+		return rc;
+	obd_timeout = val ?: 1U;
+	ping_interval = max(obd_timeout / 4, 1U);
+
+	return count;
+}
+
 /* Root for /sys/kernel/debug/lustre */
 struct dentry *debugfs_lustre_root;
 EXPORT_SYMBOL_GPL(debugfs_lustre_root);
@@ -321,6 +346,7 @@ static ssize_t jobid_this_session_store(struct kobject *kobj,
 LUSTRE_RW_ATTR(jobid_var);
 LUSTRE_RW_ATTR(jobid_name);
 LUSTRE_RW_ATTR(jobid_this_session);
+LUSTRE_RW_ATTR(timeout);
 
 static struct attribute *lustre_attrs[] = {
 	&lustre_attr_version.attr,
@@ -329,7 +355,7 @@ static ssize_t jobid_this_session_store(struct kobject *kobj,
 	&lustre_attr_jobid_name.attr,
 	&lustre_attr_jobid_var.attr,
 	&lustre_attr_jobid_this_session.attr,
-	&lustre_sattr_timeout.u.attr,
+	&lustre_attr_timeout.attr,
 	&lustre_attr_max_dirty_mb.attr,
 	&lustre_sattr_debug_peer_on_timeout.u.attr,
 	&lustre_sattr_dump_on_timeout.u.attr,
@@ -340,6 +366,8 @@ static ssize_t jobid_this_session_store(struct kobject *kobj,
 	&lustre_sattr_at_early_margin.u.attr,
 	&lustre_sattr_at_history.u.attr,
 	&lustre_sattr_lbug_on_eviction.u.attr,
+	&lustre_sattr_ping_interval.u.attr,
+	&lustre_sattr_evict_multiplier.u.attr,
 	NULL,
 };
 
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

  parent reply	other threads:[~2022-09-18  5:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18  5:21 [lustre-devel] [PATCH 00/24] lustre: update to 2.15.52 James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 01/24] lustre: dne: add crush2 hash type James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 02/24] lustre: ptlrpc: change rq_self to struct lnet_nid James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 03/24] lustre: ptlrpc: pass net num to ptlrpc_uuid_to_connection James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 04/24] lustre: ptlrpc: change rq_peer to struct lnet_nid James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 05/24] lustre: ptlrpc: change rq_source " James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 06/24] lustre: ptlrpc: change bd_sender in ptlrpc_bulk_frag_ops James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 07/24] lustre: ptlrpc: pass lnet_nid for self to ptl_send_buf() James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 08/24] lustre: llite: don't use a kms if it invalid James Simmons
2022-09-18  5:21 ` [lustre-devel] [PATCH 09/24] lustre: mdc: check/grab import before access James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 10/24] lustre: llog: handle -EBADR for catalog processing James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 11/24] lnet: Always use ping reply to set route lr_alive James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 12/24] lustre: clio: remove vvp_page_print() James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 13/24] lustre: clio: remove cpo_prep and cpo_make_ready James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 14/24] lustre: clio: remove struct vvp_page James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 15/24] lustre: clio: remove unused convenience functions James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 16/24] lustre: clio: remove cpl_obj James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 17/24] lustre: osc: remove oap_cli James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 18/24] lustre: osc: Remove submit time James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 19/24] lnet: selftest: revert "LU-16011 lnet: use preallocate bulk for server" James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 20/24] lustre: flr: allow layout version update from client/MDS James Simmons
2022-09-18  5:22 ` James Simmons [this message]
2022-09-18  5:22 ` [lustre-devel] [PATCH 22/24] lnet: allow direct messages regardless of peer NI status James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 23/24] lnet: Honor peer timeout of zero James Simmons
2022-09-18  5:22 ` [lustre-devel] [PATCH 24/24] lustre: update version to 2.15.52 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=1663478534-19917-22-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=adilger@whamcloud.com \
    --cc=alexander.boyko@hpe.com \
    --cc=green@whamcloud.com \
    --cc=lustre-devel@lists.lustre.org \
    --cc=neilb@suse.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).