summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/debug.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-03-25 17:19:59 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-04-05 11:05:03 -0700
commit5f32366a29b48bf6878ede83149819e38999c2fd (patch)
tree9d84e4d042d90c623ef4333b87f70e3f27d6256f /fs/f2fs/debug.c
parent8b8dd65f72ccbf7111eb97c4c4f5b5df2a412a07 (diff)
downloadlinux-5f32366a29b48bf6878ede83149819e38999c2fd.tar.bz2
f2fs: count discard command entry
Adds to count discard command entry and show the number in debugfs, also fix to add cost of discard command cache into total comsumed memory footprint. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r--fs/f2fs/debug.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index f27e66ea7ff3..906f627e44fc 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -67,6 +67,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
atomic_read(&SM_I(sbi)->dcc_info->issued_discard);
si->nr_discarding =
atomic_read(&SM_I(sbi)->dcc_info->issing_discard);
+ si->nr_discard_cmd =
+ atomic_read(&SM_I(sbi)->dcc_info->discard_cmd_cnt);
}
si->total_count = (int)sbi->user_block_count / sbi->blocks_per_seg;
si->rsvd_segs = reserved_segments(sbi);
@@ -220,8 +222,11 @@ get_cache:
/* build merge flush thread */
if (SM_I(sbi)->fcc_info)
si->cache_mem += sizeof(struct flush_cmd_control);
- if (SM_I(sbi)->dcc_info)
+ if (SM_I(sbi)->dcc_info) {
si->cache_mem += sizeof(struct discard_cmd_control);
+ si->cache_mem += sizeof(struct discard_cmd) *
+ atomic_read(&SM_I(sbi)->dcc_info->discard_cmd_cnt);
+ }
/* free nids */
si->cache_mem += (NM_I(sbi)->nid_cnt[FREE_NID_LIST] +
@@ -343,10 +348,11 @@ static int stat_show(struct seq_file *s, void *v)
si->ext_tree, si->zombie_tree, si->ext_node);
seq_puts(s, "\nBalancing F2FS Async:\n");
seq_printf(s, " - IO (CP: %4d, Data: %4d, Flush: (%4d %4d), "
- "Discard: (%4d %4d))\n",
+ "Discard: (%4d %4d)) cmd: %4d\n",
si->nr_wb_cp_data, si->nr_wb_data,
si->nr_flushing, si->nr_flushed,
- si->nr_discarding, si->nr_discarded);
+ si->nr_discarding, si->nr_discarded,
+ si->nr_discard_cmd);
seq_printf(s, " - inmem: %4d, atomic IO: %4d (Max. %4d), "
"volatile IO: %4d (Max. %4d)\n",
si->inmem_pages, si->aw_cnt, si->max_aw_cnt,