f2fs: add iostat support for flush

In this patch, it adds to account flush count.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Yangtao Li 2022-12-22 03:20:01 +08:00 committed by Jaegeuk Kim
parent 7a2b15cfa8
commit 193a639fed
3 changed files with 4 additions and 0 deletions

View File

@ -1192,6 +1192,7 @@ enum iostat_type {
/* other */
FS_DISCARD_IO, /* discard */
FS_FLUSH_IO, /* flush */
NR_IO_TYPE,
};

View File

@ -80,6 +80,7 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset)
/* print other IOs */
seq_puts(seq, "[OTHER]\n");
IOSTAT_INFO_SHOW("fs discard", FS_DISCARD_IO);
IOSTAT_INFO_SHOW("fs flush", FS_FLUSH_IO);
return 0;
}

View File

@ -506,6 +506,8 @@ static int __submit_flush_wait(struct f2fs_sb_info *sbi,
trace_f2fs_issue_flush(bdev, test_opt(sbi, NOBARRIER),
test_opt(sbi, FLUSH_MERGE), ret);
if (!ret)
f2fs_update_iostat(sbi, NULL, FS_FLUSH_IO, 0);
return ret;
}