diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-08-19 07:13:25 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-22 01:45:16 -0400 |
commit | 029e13cc3221be4bc46909225142277fee52c37e (patch) | |
tree | 6b649cc7932090fbb00ddab9a5b5eb6b8b40c843 /fs/f2fs/debug.c | |
parent | 91c481fff92c705dd382f1f53c01e6b6b88507d0 (diff) |
f2fs: adjust showing of extent cache stat
This patch alters to replace total hit stat with rbtree hit stat,
and then adjust showing of extent cache stat:
Hit Count:
L1-1: for largest node hit count;
L1-2: for last cached node hit count;
L2: for extent node hit after lookuping in rbtree.
Hit Ratio:
ratio (hit count / total lookup count)
Inner Struct Count:
tree count, node count.
Before:
Extent Hit Ratio: 0 / 2
Extent Tree Count: 3
Extent Node Count: 2
Patched:
Exten Cacache:
- Hit Count: L1-1:4871 L1-2:2074 L2:208
- Hit Ratio: 1% (7153 / 550751)
- Inner Struct Count: tree: 26560, node: 11824
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r-- | fs/f2fs/debug.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index 1a1a4c67a9bf..d013d8479753 100644 --- a/fs/f2fs/debug.c +++ b/fs/f2fs/debug.c | |||
@@ -35,7 +35,8 @@ static void update_general_status(struct f2fs_sb_info *sbi) | |||
35 | /* validation check of the segment numbers */ | 35 | /* validation check of the segment numbers */ |
36 | si->hit_largest = atomic_read(&sbi->read_hit_largest); | 36 | si->hit_largest = atomic_read(&sbi->read_hit_largest); |
37 | si->hit_cached = atomic_read(&sbi->read_hit_cached); | 37 | si->hit_cached = atomic_read(&sbi->read_hit_cached); |
38 | si->hit_ext = atomic_read(&sbi->read_hit_ext); | 38 | si->hit_rbtree = atomic_read(&sbi->read_hit_rbtree); |
39 | si->hit_total = si->hit_largest + si->hit_cached + si->hit_rbtree; | ||
39 | si->total_ext = atomic_read(&sbi->total_hit_ext); | 40 | si->total_ext = atomic_read(&sbi->total_hit_ext); |
40 | si->ext_tree = sbi->total_ext_tree; | 41 | si->ext_tree = sbi->total_ext_tree; |
41 | si->ext_node = atomic_read(&sbi->total_ext_node); | 42 | si->ext_node = atomic_read(&sbi->total_ext_node); |
@@ -281,11 +282,16 @@ static int stat_show(struct seq_file *s, void *v) | |||
281 | si->bg_data_blks); | 282 | si->bg_data_blks); |
282 | seq_printf(s, " - node blocks : %d (%d)\n", si->node_blks, | 283 | seq_printf(s, " - node blocks : %d (%d)\n", si->node_blks, |
283 | si->bg_node_blks); | 284 | si->bg_node_blks); |
284 | seq_printf(s, "\nExtent Hit Ratio: L1-1:%d L1-2:%d L2:%d / %d\n", | 285 | seq_puts(s, "\nExtent Cache:\n"); |
286 | seq_printf(s, " - Hit Count: L1-1:%d L1-2:%d L2:%d\n", | ||
285 | si->hit_largest, si->hit_cached, | 287 | si->hit_largest, si->hit_cached, |
286 | si->hit_ext, si->total_ext); | 288 | si->hit_rbtree); |
287 | seq_printf(s, "\nExtent Tree Count: %d\n", si->ext_tree); | 289 | seq_printf(s, " - Hit Ratio: %d%% (%d / %d)\n", |
288 | seq_printf(s, "\nExtent Node Count: %d\n", si->ext_node); | 290 | !si->total_ext ? 0 : |
291 | (si->hit_total * 100) / si->total_ext, | ||
292 | si->hit_total, si->total_ext); | ||
293 | seq_printf(s, " - Inner Struct Count: tree: %d, node: %d\n", | ||
294 | si->ext_tree, si->ext_node); | ||
289 | seq_puts(s, "\nBalancing F2FS Async:\n"); | 295 | seq_puts(s, "\nBalancing F2FS Async:\n"); |
290 | seq_printf(s, " - inmem: %4d, wb: %4d\n", | 296 | seq_printf(s, " - inmem: %4d, wb: %4d\n", |
291 | si->inmem_pages, si->wb_pages); | 297 | si->inmem_pages, si->wb_pages); |
@@ -373,7 +379,7 @@ int f2fs_build_stats(struct f2fs_sb_info *sbi) | |||
373 | sbi->stat_info = si; | 379 | sbi->stat_info = si; |
374 | 380 | ||
375 | atomic_set(&sbi->total_hit_ext, 0); | 381 | atomic_set(&sbi->total_hit_ext, 0); |
376 | atomic_set(&sbi->read_hit_ext, 0); | 382 | atomic_set(&sbi->read_hit_rbtree, 0); |
377 | atomic_set(&sbi->read_hit_largest, 0); | 383 | atomic_set(&sbi->read_hit_largest, 0); |
378 | atomic_set(&sbi->read_hit_cached, 0); | 384 | atomic_set(&sbi->read_hit_cached, 0); |
379 | 385 | ||