From 2e848e9cb7228c9febbf0c9ea957db845d7f4dc7 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Fri, 8 Nov 2024 16:28:14 +0700 Subject: [PATCH] LU-18432 llite: hybrid i/o statistics Include separate hybrid i/o read and write bytes stats: hybrid_read_bytes hybrid_write_bytes HPE-bug-id: LUS-12594 Signed-off-by: Shaun Tancheff Change-Id: I6678dd52f998cc9d24c75686c8f97eb8b6b56ebf Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56933 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alexander Zarochentsev Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- lustre/llite/file.c | 9 ++++++++- lustre/llite/llite_internal.h | 2 ++ lustre/llite/lproc_llite.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index ace2ec9..097f3a9 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -2029,13 +2029,20 @@ out: } if (iot == CIT_READ) { - if (result > 0) + if (result > 0) { ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_READ_BYTES, result); + if (args->via_hybrid_switched) + ll_stats_ops_tally(ll_i2sbi(inode), + LPROC_LL_HIO_READ, result); + } } else if (iot == CIT_WRITE) { if (result > 0) { ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_WRITE_BYTES, result); + if (args->via_hybrid_switched) + ll_stats_ops_tally(ll_i2sbi(inode), + LPROC_LL_HIO_WRITE, result); lfd->fd_write_failed = false; } else if (result == 0 && rc == 0) { rc = io->ci_result; diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 02d2e0e..6b2ebd6 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -1259,6 +1259,8 @@ void ll_free_rw_stats_info(struct ll_sb_info *sbi); enum { LPROC_LL_READ_BYTES, LPROC_LL_WRITE_BYTES, + LPROC_LL_HIO_READ, + LPROC_LL_HIO_WRITE, LPROC_LL_READ, LPROC_LL_WRITE, LPROC_LL_IOCTL, diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index c42ef0c..e481f86 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -2496,6 +2496,8 @@ static const struct llite_file_opcode { /* file operation */ { LPROC_LL_READ_BYTES, LPROCFS_TYPE_BYTES_FULL, "read_bytes" }, { LPROC_LL_WRITE_BYTES, LPROCFS_TYPE_BYTES_FULL, "write_bytes" }, + { LPROC_LL_HIO_READ, LPROCFS_TYPE_BYTES_FULL, "hybrid_read_bytes" }, + { LPROC_LL_HIO_WRITE, LPROCFS_TYPE_BYTES_FULL, "hybrid_write_bytes" }, { LPROC_LL_READ, LPROCFS_TYPE_LATENCY, "read" }, { LPROC_LL_WRITE, LPROCFS_TYPE_LATENCY, "write" }, { LPROC_LL_IOCTL, LPROCFS_TYPE_REQS, "ioctl" }, -- 1.8.3.1