f2fs: add write latency stats for NAT and SIT blocks in f2fs_write_checkpoint

This patch adds separate write latency accounting for NAT and SIT blocks
in f2fs_write_checkpoint().

Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Yongpeng Yang 2026-01-13 23:21:37 +08:00 committed by Jaegeuk Kim
parent be38b5717a
commit 401a3034d3
2 changed files with 6 additions and 2 deletions

View File

@ -1839,6 +1839,7 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
goto out;
}
}
stat_cp_time(cpc, CP_TIME_MERGE_WRITE);
/*
* update checkpoint pack index
@ -1855,10 +1856,11 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
f2fs_bug_on(sbi, !f2fs_cp_error(sbi));
goto stop;
}
stat_cp_time(cpc, CP_TIME_FLUSH_NAT);
f2fs_flush_sit_entries(sbi, cpc);
stat_cp_time(cpc, CP_TIME_FLUSH_META);
stat_cp_time(cpc, CP_TIME_FLUSH_SIT);
/* save inmem log status */
f2fs_save_inmem_curseg(sbi);

View File

@ -319,7 +319,9 @@ enum cp_time {
CP_TIME_START, /* begin */
CP_TIME_LOCK, /* after cp_global_sem */
CP_TIME_OP_LOCK, /* after block_operation */
CP_TIME_FLUSH_META, /* after flush sit/nat */
CP_TIME_MERGE_WRITE, /* after flush DATA/NODE/META */
CP_TIME_FLUSH_NAT, /* after flush nat */
CP_TIME_FLUSH_SIT, /* after flush sit */
CP_TIME_SYNC_META, /* after sync_meta_pages */
CP_TIME_SYNC_CP_META, /* after sync cp meta pages */
CP_TIME_WAIT_DIRTY_META,/* after wait on dirty meta */