diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-08-19 19:13:25 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-21 22:45:16 -0700 |
commit | 029e13cc3221be4bc46909225142277fee52c37e (patch) | |
tree | 6b649cc7932090fbb00ddab9a5b5eb6b8b40c843 /fs/f2fs/extent_cache.c | |
parent | 91c481fff92c705dd382f1f53c01e6b6b88507d0 (diff) | |
download | blackbird-op-linux-029e13cc3221be4bc46909225142277fee52c37e.tar.gz blackbird-op-linux-029e13cc3221be4bc46909225142277fee52c37e.zip |
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/extent_cache.c')
-rw-r--r-- | fs/f2fs/extent_cache.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index 5cf217faed1f..d11735aa3cac 100644 --- a/fs/f2fs/extent_cache.c +++ b/fs/f2fs/extent_cache.c @@ -99,12 +99,14 @@ static struct extent_node *__lookup_extent_tree(struct f2fs_sb_info *sbi, while (node) { en = rb_entry(node, struct extent_node, rb_node); - if (fofs < en->ei.fofs) + if (fofs < en->ei.fofs) { node = node->rb_left; - else if (fofs >= en->ei.fofs + en->ei.len) + } else if (fofs >= en->ei.fofs + en->ei.len) { node = node->rb_right; - else + } else { + stat_inc_rbtree_node_hit(sbi); return en; + } } return NULL; } @@ -281,7 +283,6 @@ static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, et->largest.fofs + et->largest.len > pgofs) { *ei = et->largest; ret = true; - stat_inc_read_hit(sbi); stat_inc_largest_node_hit(sbi); goto out; } @@ -295,7 +296,6 @@ static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, et->cached_en = en; spin_unlock(&sbi->extent_lock); ret = true; - stat_inc_read_hit(sbi); } out: stat_inc_total_hit(sbi); |