Skip to content

Commit 401a303

Browse files
Yongpeng YangJaegeuk Kim
authored andcommitted
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>
1 parent be38b57 commit 401a303

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

fs/f2fs/checkpoint.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,7 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
18391839
goto out;
18401840
}
18411841
}
1842+
stat_cp_time(cpc, CP_TIME_MERGE_WRITE);
18421843

18431844
/*
18441845
* update checkpoint pack index
@@ -1855,10 +1856,11 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
18551856
f2fs_bug_on(sbi, !f2fs_cp_error(sbi));
18561857
goto stop;
18571858
}
1859+
stat_cp_time(cpc, CP_TIME_FLUSH_NAT);
18581860

18591861
f2fs_flush_sit_entries(sbi, cpc);
18601862

1861-
stat_cp_time(cpc, CP_TIME_FLUSH_META);
1863+
stat_cp_time(cpc, CP_TIME_FLUSH_SIT);
18621864

18631865
/* save inmem log status */
18641866
f2fs_save_inmem_curseg(sbi);

fs/f2fs/f2fs.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ enum cp_time {
319319
CP_TIME_START, /* begin */
320320
CP_TIME_LOCK, /* after cp_global_sem */
321321
CP_TIME_OP_LOCK, /* after block_operation */
322-
CP_TIME_FLUSH_META, /* after flush sit/nat */
322+
CP_TIME_MERGE_WRITE, /* after flush DATA/NODE/META */
323+
CP_TIME_FLUSH_NAT, /* after flush nat */
324+
CP_TIME_FLUSH_SIT, /* after flush sit */
323325
CP_TIME_SYNC_META, /* after sync_meta_pages */
324326
CP_TIME_SYNC_CP_META, /* after sync cp meta pages */
325327
CP_TIME_WAIT_DIRTY_META,/* after wait on dirty meta */

0 commit comments

Comments
 (0)