aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-01-10 07:09:52 -0500
committerJaegeuk Kim <jaegeuk@kernel.org>2015-02-11 20:04:31 -0500
commit9066c6a7eb5492dda0ccd48bb78be52feff9043c (patch)
tree9f282a3a20ab09bd86db5db34e0ce0668eedfbef /fs/f2fs
parent871f599f4a869d24ef98b0217f19f0cc55ff59ac (diff)
f2fs: fix wrong memory footprint statistics in debugfs
Our value of memory footprint statistics showed in debugfs is not calculated correctly. Fix it in this patch. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/debug.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 1f0fb58072e7..b45daab97f0b 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -163,13 +163,20 @@ static void update_mem_info(struct f2fs_sb_info *sbi)
163 si->base_mem += sizeof(struct f2fs_nm_info); 163 si->base_mem += sizeof(struct f2fs_nm_info);
164 si->base_mem += __bitmap_size(sbi, NAT_BITMAP); 164 si->base_mem += __bitmap_size(sbi, NAT_BITMAP);
165 165
166get_cache:
167 si->cache_mem = 0;
168
166 /* build gc */ 169 /* build gc */
167 si->base_mem += sizeof(struct f2fs_gc_kthread); 170 if (sbi->gc_thread)
171 si->cache_mem += sizeof(struct f2fs_gc_kthread);
172
173 /* build merge flush thread */
174 if (SM_I(sbi)->cmd_control_info)
175 si->cache_mem += sizeof(struct flush_cmd_control);
168 176
169get_cache:
170 /* free nids */ 177 /* free nids */
171 si->cache_mem = NM_I(sbi)->fcnt; 178 si->cache_mem += NM_I(sbi)->fcnt * sizeof(struct free_nid);
172 si->cache_mem += NM_I(sbi)->nat_cnt; 179 si->cache_mem += NM_I(sbi)->nat_cnt * sizeof(struct nat_entry);
173 npages = NODE_MAPPING(sbi)->nrpages; 180 npages = NODE_MAPPING(sbi)->nrpages;
174 si->cache_mem += npages << PAGE_CACHE_SHIFT; 181 si->cache_mem += npages << PAGE_CACHE_SHIFT;
175 npages = META_MAPPING(sbi)->nrpages; 182 npages = META_MAPPING(sbi)->nrpages;