Commit 9c122384 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: add compressed/gc data read IO stat

in order to account data read IOs more accurately.
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent f3494345
...@@ -2234,6 +2234,7 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret, ...@@ -2234,6 +2234,7 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
inc_page_count(sbi, F2FS_RD_DATA); inc_page_count(sbi, F2FS_RD_DATA);
f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE); f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE);
f2fs_update_iostat(sbi, FS_CDATA_READ_IO, F2FS_BLKSIZE);
ClearPageError(page); ClearPageError(page);
*last_block_in_bio = blkaddr; *last_block_in_bio = blkaddr;
} }
......
...@@ -1149,6 +1149,8 @@ enum iostat_type { ...@@ -1149,6 +1149,8 @@ enum iostat_type {
APP_READ_IO, /* app read IOs */ APP_READ_IO, /* app read IOs */
APP_MAPPED_READ_IO, /* app mapped read IOs */ APP_MAPPED_READ_IO, /* app mapped read IOs */
FS_DATA_READ_IO, /* data read IOs */ FS_DATA_READ_IO, /* data read IOs */
FS_GDATA_READ_IO, /* data read IOs from background gc */
FS_CDATA_READ_IO, /* compressed data read IOs */
FS_NODE_READ_IO, /* node read IOs */ FS_NODE_READ_IO, /* node read IOs */
FS_META_READ_IO, /* meta read IOs */ FS_META_READ_IO, /* meta read IOs */
......
...@@ -740,6 +740,7 @@ static int ra_data_block(struct inode *inode, pgoff_t index) ...@@ -740,6 +740,7 @@ static int ra_data_block(struct inode *inode, pgoff_t index)
f2fs_put_page(page, 1); f2fs_put_page(page, 1);
f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE); f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE);
f2fs_update_iostat(sbi, FS_GDATA_READ_IO, F2FS_BLKSIZE);
return 0; return 0;
put_encrypted_page: put_encrypted_page:
...@@ -846,6 +847,7 @@ static int move_data_block(struct inode *inode, block_t bidx, ...@@ -846,6 +847,7 @@ static int move_data_block(struct inode *inode, block_t bidx,
} }
f2fs_update_iostat(fio.sbi, FS_DATA_READ_IO, F2FS_BLKSIZE); f2fs_update_iostat(fio.sbi, FS_DATA_READ_IO, F2FS_BLKSIZE);
f2fs_update_iostat(fio.sbi, FS_GDATA_READ_IO, F2FS_BLKSIZE);
lock_page(mpage); lock_page(mpage);
if (unlikely(mpage->mapping != META_MAPPING(fio.sbi) || if (unlikely(mpage->mapping != META_MAPPING(fio.sbi) ||
......
...@@ -803,6 +803,7 @@ static int __maybe_unused iostat_info_seq_show(struct seq_file *seq, ...@@ -803,6 +803,7 @@ static int __maybe_unused iostat_info_seq_show(struct seq_file *seq,
seq_printf(seq, "time: %-16llu\n", now); seq_printf(seq, "time: %-16llu\n", now);
/* print app write IOs */ /* print app write IOs */
seq_puts(seq, "[WRITE]\n");
seq_printf(seq, "app buffered: %-16llu\n", seq_printf(seq, "app buffered: %-16llu\n",
sbi->rw_iostat[APP_BUFFERED_IO]); sbi->rw_iostat[APP_BUFFERED_IO]);
seq_printf(seq, "app direct: %-16llu\n", seq_printf(seq, "app direct: %-16llu\n",
...@@ -829,6 +830,7 @@ static int __maybe_unused iostat_info_seq_show(struct seq_file *seq, ...@@ -829,6 +830,7 @@ static int __maybe_unused iostat_info_seq_show(struct seq_file *seq,
sbi->rw_iostat[FS_CP_META_IO]); sbi->rw_iostat[FS_CP_META_IO]);
/* print app read IOs */ /* print app read IOs */
seq_puts(seq, "[READ]\n");
seq_printf(seq, "app buffered: %-16llu\n", seq_printf(seq, "app buffered: %-16llu\n",
sbi->rw_iostat[APP_BUFFERED_READ_IO]); sbi->rw_iostat[APP_BUFFERED_READ_IO]);
seq_printf(seq, "app direct: %-16llu\n", seq_printf(seq, "app direct: %-16llu\n",
...@@ -839,12 +841,17 @@ static int __maybe_unused iostat_info_seq_show(struct seq_file *seq, ...@@ -839,12 +841,17 @@ static int __maybe_unused iostat_info_seq_show(struct seq_file *seq,
/* print fs read IOs */ /* print fs read IOs */
seq_printf(seq, "fs data: %-16llu\n", seq_printf(seq, "fs data: %-16llu\n",
sbi->rw_iostat[FS_DATA_READ_IO]); sbi->rw_iostat[FS_DATA_READ_IO]);
seq_printf(seq, "fs gc data: %-16llu\n",
sbi->rw_iostat[FS_GDATA_READ_IO]);
seq_printf(seq, "fs compr_data: %-16llu\n",
sbi->rw_iostat[FS_CDATA_READ_IO]);
seq_printf(seq, "fs node: %-16llu\n", seq_printf(seq, "fs node: %-16llu\n",
sbi->rw_iostat[FS_NODE_READ_IO]); sbi->rw_iostat[FS_NODE_READ_IO]);
seq_printf(seq, "fs meta: %-16llu\n", seq_printf(seq, "fs meta: %-16llu\n",
sbi->rw_iostat[FS_META_READ_IO]); sbi->rw_iostat[FS_META_READ_IO]);
/* print other IOs */ /* print other IOs */
seq_puts(seq, "[OTHER]\n");
seq_printf(seq, "fs discard: %-16llu\n", seq_printf(seq, "fs discard: %-16llu\n",
sbi->rw_iostat[FS_DISCARD]); sbi->rw_iostat[FS_DISCARD]);
......
...@@ -1840,6 +1840,8 @@ TRACE_EVENT(f2fs_iostat, ...@@ -1840,6 +1840,8 @@ TRACE_EVENT(f2fs_iostat,
__field(unsigned long long, app_rio) __field(unsigned long long, app_rio)
__field(unsigned long long, app_mrio) __field(unsigned long long, app_mrio)
__field(unsigned long long, fs_drio) __field(unsigned long long, fs_drio)
__field(unsigned long long, fs_gdrio)
__field(unsigned long long, fs_cdrio)
__field(unsigned long long, fs_nrio) __field(unsigned long long, fs_nrio)
__field(unsigned long long, fs_mrio) __field(unsigned long long, fs_mrio)
__field(unsigned long long, fs_discard) __field(unsigned long long, fs_discard)
...@@ -1864,6 +1866,8 @@ TRACE_EVENT(f2fs_iostat, ...@@ -1864,6 +1866,8 @@ TRACE_EVENT(f2fs_iostat,
__entry->app_rio = iostat[APP_READ_IO]; __entry->app_rio = iostat[APP_READ_IO];
__entry->app_mrio = iostat[APP_MAPPED_READ_IO]; __entry->app_mrio = iostat[APP_MAPPED_READ_IO];
__entry->fs_drio = iostat[FS_DATA_READ_IO]; __entry->fs_drio = iostat[FS_DATA_READ_IO];
__entry->fs_gdrio = iostat[FS_GDATA_READ_IO];
__entry->fs_cdrio = iostat[FS_CDATA_READ_IO];
__entry->fs_nrio = iostat[FS_NODE_READ_IO]; __entry->fs_nrio = iostat[FS_NODE_READ_IO];
__entry->fs_mrio = iostat[FS_META_READ_IO]; __entry->fs_mrio = iostat[FS_META_READ_IO];
__entry->fs_discard = iostat[FS_DISCARD]; __entry->fs_discard = iostat[FS_DISCARD];
...@@ -1875,15 +1879,16 @@ TRACE_EVENT(f2fs_iostat, ...@@ -1875,15 +1879,16 @@ TRACE_EVENT(f2fs_iostat,
"gc [data=%llu, node=%llu], " "gc [data=%llu, node=%llu], "
"cp [data=%llu, node=%llu, meta=%llu], " "cp [data=%llu, node=%llu, meta=%llu], "
"app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], " "app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
"fs [data=%llu, node=%llu, meta=%llu]", "fs [data=%llu, (gc_data=%llu, compr_data=%llu), "
"node=%llu, meta=%llu]",
show_dev(__entry->dev), __entry->app_wio, __entry->app_dio, show_dev(__entry->dev), __entry->app_wio, __entry->app_dio,
__entry->app_bio, __entry->app_mio, __entry->fs_dio, __entry->app_bio, __entry->app_mio, __entry->fs_dio,
__entry->fs_nio, __entry->fs_mio, __entry->fs_discard, __entry->fs_nio, __entry->fs_mio, __entry->fs_discard,
__entry->fs_gc_dio, __entry->fs_gc_nio, __entry->fs_cp_dio, __entry->fs_gc_dio, __entry->fs_gc_nio, __entry->fs_cp_dio,
__entry->fs_cp_nio, __entry->fs_cp_mio, __entry->fs_cp_nio, __entry->fs_cp_mio,
__entry->app_rio, __entry->app_drio, __entry->app_brio, __entry->app_rio, __entry->app_drio, __entry->app_brio,
__entry->app_mrio, __entry->fs_drio, __entry->fs_nrio, __entry->app_mrio, __entry->fs_drio, __entry->fs_gdrio,
__entry->fs_mrio) __entry->fs_cdrio, __entry->fs_nrio, __entry->fs_mrio)
); );
#endif /* _TRACE_F2FS_H */ #endif /* _TRACE_F2FS_H */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment