diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-03-22 05:23:45 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-24 15:10:50 -0400 |
commit | 648d50ba12c805d3fc75105ede7af254b3349dbd (patch) | |
tree | 4efe2862ac68aa102ed46a03307e4a426456166a /fs/f2fs/f2fs.h | |
parent | 30a61ddf8117c26ac5b295e1233eaa9629a94ca3 (diff) |
f2fs: show the max number of volatile operations
This patch adds to show the max number of volatile operations which are
conducting concurrently.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index a481c8e39b7c..340d62c29a98 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -915,7 +915,9 @@ struct f2fs_sb_info { | |||
915 | atomic_t inline_inode; /* # of inline_data inodes */ | 915 | atomic_t inline_inode; /* # of inline_data inodes */ |
916 | atomic_t inline_dir; /* # of inline_dentry inodes */ | 916 | atomic_t inline_dir; /* # of inline_dentry inodes */ |
917 | atomic_t aw_cnt; /* # of atomic writes */ | 917 | atomic_t aw_cnt; /* # of atomic writes */ |
918 | atomic_t vw_cnt; /* # of volatile writes */ | ||
918 | atomic_t max_aw_cnt; /* max # of atomic writes */ | 919 | atomic_t max_aw_cnt; /* max # of atomic writes */ |
920 | atomic_t max_vw_cnt; /* max # of volatile writes */ | ||
919 | int bg_gc; /* background gc calls */ | 921 | int bg_gc; /* background gc calls */ |
920 | unsigned int ndirty_inode[NR_INODE_TYPE]; /* # of dirty inodes */ | 922 | unsigned int ndirty_inode[NR_INODE_TYPE]; /* # of dirty inodes */ |
921 | #endif | 923 | #endif |
@@ -2328,7 +2330,7 @@ struct f2fs_stat_info { | |||
2328 | int total_count, utilization; | 2330 | int total_count, utilization; |
2329 | int bg_gc, nr_wb_cp_data, nr_wb_data, nr_flush, nr_discard; | 2331 | int bg_gc, nr_wb_cp_data, nr_wb_data, nr_flush, nr_discard; |
2330 | int inline_xattr, inline_inode, inline_dir, append, update, orphans; | 2332 | int inline_xattr, inline_inode, inline_dir, append, update, orphans; |
2331 | int aw_cnt, max_aw_cnt; | 2333 | int aw_cnt, max_aw_cnt, vw_cnt, max_vw_cnt; |
2332 | unsigned int valid_count, valid_node_count, valid_inode_count, discard_blks; | 2334 | unsigned int valid_count, valid_node_count, valid_inode_count, discard_blks; |
2333 | unsigned int bimodal, avg_vblocks; | 2335 | unsigned int bimodal, avg_vblocks; |
2334 | int util_free, util_valid, util_invalid; | 2336 | int util_free, util_valid, util_invalid; |
@@ -2411,6 +2413,17 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi) | |||
2411 | if (cur > max) \ | 2413 | if (cur > max) \ |
2412 | atomic_set(&F2FS_I_SB(inode)->max_aw_cnt, cur); \ | 2414 | atomic_set(&F2FS_I_SB(inode)->max_aw_cnt, cur); \ |
2413 | } while (0) | 2415 | } while (0) |
2416 | #define stat_inc_volatile_write(inode) \ | ||
2417 | (atomic_inc(&F2FS_I_SB(inode)->vw_cnt)) | ||
2418 | #define stat_dec_volatile_write(inode) \ | ||
2419 | (atomic_dec(&F2FS_I_SB(inode)->vw_cnt)) | ||
2420 | #define stat_update_max_volatile_write(inode) \ | ||
2421 | do { \ | ||
2422 | int cur = atomic_read(&F2FS_I_SB(inode)->vw_cnt); \ | ||
2423 | int max = atomic_read(&F2FS_I_SB(inode)->max_vw_cnt); \ | ||
2424 | if (cur > max) \ | ||
2425 | atomic_set(&F2FS_I_SB(inode)->max_vw_cnt, cur); \ | ||
2426 | } while (0) | ||
2414 | #define stat_inc_seg_count(sbi, type, gc_type) \ | 2427 | #define stat_inc_seg_count(sbi, type, gc_type) \ |
2415 | do { \ | 2428 | do { \ |
2416 | struct f2fs_stat_info *si = F2FS_STAT(sbi); \ | 2429 | struct f2fs_stat_info *si = F2FS_STAT(sbi); \ |
@@ -2467,6 +2480,9 @@ void f2fs_destroy_root_stats(void); | |||
2467 | #define stat_inc_atomic_write(inode) | 2480 | #define stat_inc_atomic_write(inode) |
2468 | #define stat_dec_atomic_write(inode) | 2481 | #define stat_dec_atomic_write(inode) |
2469 | #define stat_update_max_atomic_write(inode) | 2482 | #define stat_update_max_atomic_write(inode) |
2483 | #define stat_inc_volatile_write(inode) | ||
2484 | #define stat_dec_volatile_write(inode) | ||
2485 | #define stat_update_max_volatile_write(inode) | ||
2470 | #define stat_inc_seg_type(sbi, curseg) | 2486 | #define stat_inc_seg_type(sbi, curseg) |
2471 | #define stat_inc_block_count(sbi, curseg) | 2487 | #define stat_inc_block_count(sbi, curseg) |
2472 | #define stat_inc_inplace_blocks(sbi) | 2488 | #define stat_inc_inplace_blocks(sbi) |