From 7af7961f8d7eace42d6d24570c1222b4eb9335b2 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 3 Feb 2024 17:44:13 -0700 Subject: [PATCH] DDN-4656 osd-ldiskfs: hide alloc time in brw_stats For EXA6.0/6.1 do not show the "block maps msec" stats in brw_stats by default as this breaks collectd and lustrefs_collector parsing. Base this check on the Linux kernel version, since those releases were based on RHEL7.9 on the server, while EXA6.2/6.3 use RHEL8. Add an "enable_brw_block_maps" parameter that can be used to disable the display of this statistic (it is always collected). Enable the "enable_stats_header" parameter automatically in the same way, as this was added for EXA6.2 but should now be supported. Test-Parameters: trivial Fixes: c1e43cf8e0 ("LU-15564 osd: add allocation time histogram") Signed-off-by: Andreas Dilger Change-Id: Ib5e33bd98085aaf4a5a5d39283d5d334b93ebbe5 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53903 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev --- lnet/lnet/lib-ptl.c | 0 lustre/include/lprocfs_status.h | 1 + lustre/obdclass/lprocfs_status.c | 15 +++++++++++++-- lustre/obdclass/lprocfs_status_server.c | 4 ++++ lustre/obdclass/obd_sysfs.c | 2 ++ lustre/utils/gss/sk_utils.c | 0 6 files changed, 20 insertions(+), 2 deletions(-) mode change 100755 => 100644 lnet/lnet/lib-ptl.c mode change 100755 => 100644 lustre/utils/gss/sk_utils.c diff --git a/lnet/lnet/lib-ptl.c b/lnet/lnet/lib-ptl.c old mode 100755 new mode 100644 diff --git a/lustre/include/lprocfs_status.h b/lustre/include/lprocfs_status.h index 32ce0e8..4d7397f 100644 --- a/lustre/include/lprocfs_status.h +++ b/lustre/include/lprocfs_status.h @@ -587,6 +587,7 @@ extern void lprocfs_stats_header(struct seq_file *seq, ktime_t now, ktime_t ts_init, int width, const char *colon, bool show_units, const char *prefix); extern unsigned int obd_enable_stats_header; +extern unsigned int obd_enable_brw_block_maps; /* Generic callbacks */ extern int lprocfs_uuid_seq_show(struct seq_file *m, void *data); diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 9a15590..97a2bd0 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -41,8 +41,19 @@ #ifdef CONFIG_PROC_FS -/* disable start/elapsed_time in stats headers by default for compatibility */ -unsigned int obd_enable_stats_header; +/* To avoid displaying newer stats by default for EXA6.0/6.1, use the + * kernel version by proxy since servers used el7.9 with kernel 3.10. + * There isn't an easy way to distinguish between EXA6.1*/ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) +#define OBD_ENABLE_STATS_DEFAULT = 1 +#else +#define OBD_ENABLE_STATS_DEFAULT +#endif + +/* allow start/elapsed_time in stats headers to be disabled for compatibility */ +unsigned int obd_enable_stats_header OBD_ENABLE_STATS_DEFAULT; +/* allow "block maps msec" in brw_stats to be disabled for compatibility */ +unsigned int obd_enable_brw_block_maps OBD_ENABLE_STATS_DEFAULT; static int lprocfs_no_percpu_stats = 0; module_param(lprocfs_no_percpu_stats, int, 0644); diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c index d785c50..186e359 100644 --- a/lustre/obdclass/lprocfs_status_server.c +++ b/lustre/obdclass/lprocfs_status_server.c @@ -753,6 +753,10 @@ static int brw_stats_seq_show(struct seq_file *seq, void *v) if (!brw_stats->bs_props[i].bsp_name) continue; + /* skip allocation time for older releases */ + if (!obd_enable_brw_block_maps && i == BRW_ALLOC_TIME) + continue; + display_brw_stats(seq, brw_stats->bs_props[i].bsp_name, brw_stats->bs_props[i].bsp_units, &brw_stats->bs_hist[i * 2], diff --git a/lustre/obdclass/obd_sysfs.c b/lustre/obdclass/obd_sysfs.c index fb48554..e525de2 100644 --- a/lustre/obdclass/obd_sysfs.c +++ b/lustre/obdclass/obd_sysfs.c @@ -122,6 +122,7 @@ LUSTRE_STATIC_UINT_ATTR(at_extra, &at_extra); LUSTRE_STATIC_UINT_ATTR(at_early_margin, &at_early_margin); LUSTRE_STATIC_UINT_ATTR(at_history, &at_history); LUSTRE_STATIC_UINT_ATTR(enable_stats_header, &obd_enable_stats_header); +LUSTRE_STATIC_UINT_ATTR(enable_brw_block_maps, &obd_enable_brw_block_maps); LUSTRE_STATIC_UINT_ATTR(lbug_on_eviction, &obd_lbug_on_eviction); #ifdef HAVE_SERVER_SUPPORT @@ -401,6 +402,7 @@ static struct attribute *lustre_attrs[] = { &lustre_attr_version.attr, &lustre_attr_pinger.attr, &lustre_sattr_enable_stats_header.u.attr, + &lustre_sattr_enable_brw_block_maps.u.attr, &lustre_attr_health_check.attr, &lustre_attr_jobid_name.attr, &lustre_attr_jobid_var.attr, diff --git a/lustre/utils/gss/sk_utils.c b/lustre/utils/gss/sk_utils.c old mode 100755 new mode 100644 -- 1.8.3.1