2023-12-04 07:30:49

by Kunhai Dai

[permalink] [raw]
Subject: [PATCH] xfs: adjust the offset of the log statistics line

It would be more preferable to present xs_try_logspace and
xs_sleep_logspace on the log line.

Signed-off-by: Kunhai Dai <[email protected]>
---
fs/xfs/xfs_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_stats.c b/fs/xfs/xfs_stats.c
index 90a77cd3ebad..92ff3a22cbc9 100644
--- a/fs/xfs/xfs_stats.c
+++ b/fs/xfs/xfs_stats.c
@@ -36,7 +36,7 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
{ "dir", xfsstats_offset(xs_trans_sync) },
{ "trans", xfsstats_offset(xs_ig_attempts) },
{ "ig", xfsstats_offset(xs_log_writes) },
- { "log", xfsstats_offset(xs_try_logspace)},
+ { "log", xfsstats_offset(xs_push_ail)},
{ "push_ail", xfsstats_offset(xs_xstrat_quick)},
{ "xstrat", xfsstats_offset(xs_write_calls) },
{ "rw", xfsstats_offset(xs_attr_get) },
--
2.27.0


2023-12-05 01:12:58

by Dave Chinner

[permalink] [raw]
Subject: Re: [PATCH] xfs: adjust the offset of the log statistics line

On Mon, Dec 04, 2023 at 02:26:44AM -0500, Kunhai Dai wrote:
> It would be more preferable to present xs_try_logspace and
> xs_sleep_logspace on the log line.

xs_try_logspace and xs_sleep_logspace are AIL tail pushing
statistics. They are related to reservation space exhaustion, not
journal operations, so they really are located in the correct stats
namespace.

Regardless of whether they are correctly located, we can't change
the layout of this file like this - it forms part of the user kABI.
The file format was defined back in June 2000 (early stages of the
XFS port to Linux) and so any change to the layout of the file will
break every application and script every written that parses it.

So while it might be "preferable" to change the order of stats in
the file to group them better, we simply cannot do that because it
will break userspace.

Cheers,

-Dave.
--
Dave Chinner
[email protected]