Whamcloud - gitweb
DDN-4656 osd-ldiskfs: hide alloc time in brw_stats
authorAndreas Dilger <adilger@whamcloud.com>
Sun, 4 Feb 2024 00:44:13 +0000 (17:44 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 8 Feb 2024 08:54:02 +0000 (08:54 +0000)
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 <adilger@whamcloud.com>
Change-Id: Ib5e33bd98085aaf4a5a5d39283d5d334b93ebbe5
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53903
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lnet/lnet/lib-ptl.c [changed mode: 0755->0644]
lustre/include/lprocfs_status.h
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lprocfs_status_server.c
lustre/obdclass/obd_sysfs.c
lustre/utils/gss/sk_utils.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 32ce0e8..4d7397f 100644 (file)
@@ -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);
index 9a15590..97a2bd0 100644 (file)
 
 #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);
index d785c50..186e359 100644 (file)
@@ -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],
index fb48554..e525de2 100644 (file)
@@ -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,
old mode 100755 (executable)
new mode 100644 (file)