diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-01-09 16:45:17 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-01-11 18:56:42 -0500 |
commit | 42190d2a8663f3e181894dc4e37a1af06aab2cbb (patch) | |
tree | e6240dfb414053f3c4f937f32597cd2f0fc69408 | |
parent | d0239e1bf5204d602281f93c01d46bcf3531098d (diff) |
f2fs: monitor the number of background checkpoint
This patch adds to show the number of background checkpoint.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/debug.c | 3 | ||||
-rw-r--r-- | fs/f2fs/f2fs.h | 4 | ||||
-rw-r--r-- | fs/f2fs/segment.c | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index b73e8e133c8b..48f2ae9452ef 100644 --- a/fs/f2fs/debug.c +++ b/fs/f2fs/debug.c | |||
@@ -272,7 +272,8 @@ static int stat_show(struct seq_file *s, void *v) | |||
272 | si->dirty_count); | 272 | si->dirty_count); |
273 | seq_printf(s, " - Prefree: %d\n - Free: %d (%d)\n\n", | 273 | seq_printf(s, " - Prefree: %d\n - Free: %d (%d)\n\n", |
274 | si->prefree_count, si->free_segs, si->free_secs); | 274 | si->prefree_count, si->free_segs, si->free_secs); |
275 | seq_printf(s, "CP calls: %d\n", si->cp_count); | 275 | seq_printf(s, "CP calls: %d (BG: %d)\n", |
276 | si->cp_count, si->bg_cp_count); | ||
276 | seq_printf(s, "GC calls: %d (BG: %d)\n", | 277 | seq_printf(s, "GC calls: %d (BG: %d)\n", |
277 | si->call_count, si->bg_gc); | 278 | si->call_count, si->bg_gc); |
278 | seq_printf(s, " - data segments : %d (%d)\n", | 279 | seq_printf(s, " - data segments : %d (%d)\n", |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4331b9fe6f27..2c0e478cefb4 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -1937,7 +1937,7 @@ struct f2fs_stat_info { | |||
1937 | int util_free, util_valid, util_invalid; | 1937 | int util_free, util_valid, util_invalid; |
1938 | int rsvd_segs, overp_segs; | 1938 | int rsvd_segs, overp_segs; |
1939 | int dirty_count, node_pages, meta_pages; | 1939 | int dirty_count, node_pages, meta_pages; |
1940 | int prefree_count, call_count, cp_count; | 1940 | int prefree_count, call_count, cp_count, bg_cp_count; |
1941 | int tot_segs, node_segs, data_segs, free_segs, free_secs; | 1941 | int tot_segs, node_segs, data_segs, free_segs, free_secs; |
1942 | int bg_node_segs, bg_data_segs; | 1942 | int bg_node_segs, bg_data_segs; |
1943 | int tot_blks, data_blks, node_blks; | 1943 | int tot_blks, data_blks, node_blks; |
@@ -1958,6 +1958,7 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi) | |||
1958 | } | 1958 | } |
1959 | 1959 | ||
1960 | #define stat_inc_cp_count(si) ((si)->cp_count++) | 1960 | #define stat_inc_cp_count(si) ((si)->cp_count++) |
1961 | #define stat_inc_bg_cp_count(si) ((si)->bg_cp_count++) | ||
1961 | #define stat_inc_call_count(si) ((si)->call_count++) | 1962 | #define stat_inc_call_count(si) ((si)->call_count++) |
1962 | #define stat_inc_bggc_count(sbi) ((sbi)->bg_gc++) | 1963 | #define stat_inc_bggc_count(sbi) ((sbi)->bg_gc++) |
1963 | #define stat_inc_dirty_inode(sbi, type) ((sbi)->ndirty_inode[type]++) | 1964 | #define stat_inc_dirty_inode(sbi, type) ((sbi)->ndirty_inode[type]++) |
@@ -2040,6 +2041,7 @@ int __init f2fs_create_root_stats(void); | |||
2040 | void f2fs_destroy_root_stats(void); | 2041 | void f2fs_destroy_root_stats(void); |
2041 | #else | 2042 | #else |
2042 | #define stat_inc_cp_count(si) | 2043 | #define stat_inc_cp_count(si) |
2044 | #define stat_inc_bg_cp_count(si) | ||
2043 | #define stat_inc_call_count(si) | 2045 | #define stat_inc_call_count(si) |
2044 | #define stat_inc_bggc_count(si) | 2046 | #define stat_inc_bggc_count(si) |
2045 | #define stat_inc_dirty_inode(sbi, type) | 2047 | #define stat_inc_dirty_inode(sbi, type) |
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index d8ad1abfa4fd..5904a411c86f 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -297,6 +297,7 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi) | |||
297 | if (test_opt(sbi, DATA_FLUSH)) | 297 | if (test_opt(sbi, DATA_FLUSH)) |
298 | sync_dirty_inodes(sbi, FILE_INODE); | 298 | sync_dirty_inodes(sbi, FILE_INODE); |
299 | f2fs_sync_fs(sbi->sb, true); | 299 | f2fs_sync_fs(sbi->sb, true); |
300 | stat_inc_bg_cp_count(sbi->stat_info); | ||
300 | } | 301 | } |
301 | } | 302 | } |
302 | 303 | ||