[f2fs-dev] [PATCH v2 04/10] f2fs: introduce universal lookup/update interface of extent cache

2015-01-25 Thread Chao Yu
In this patch, we do these jobs: 1. rename {check,update}_extent_cache to {lookup,update}_extent_info; 2. introduce universal lookup/update interface of extent cache: f2fs_{lookup,update}_extent_cache including above two real functions, then export them to function callers. So after above

[f2fs-dev] [PATCH v2 03/10] f2fs: introduce f2fs_map_bh to simplify codes of check_extent_cache

2015-01-25 Thread Chao Yu
This patch introduces f2fs_map_bh to simplify codes of check_extent_cache. v2: o clean up f2fs_map_bh pointed out by Jaegeuk Kim. Signed-off-by: Chao Yu chao2...@samsung.com --- fs/f2fs/data.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff

[f2fs-dev] [PATCH v2 01/10] f2fs: move ext_lock out of struct extent_info

2015-01-25 Thread Chao Yu
Move ext_lock out of struct extent_info, then in the following patches we can use variables with struct extent_info type as a parameter to pass pure data. Signed-off-by: Chao Yu chao2...@samsung.com --- fs/f2fs/data.c | 12 ++-- fs/f2fs/f2fs.h | 6 +- fs/f2fs/inode.c | 7 +++

[f2fs-dev] [PATCH v2 02/10] f2fs: simplfy a field name in struct f2fs_extent, extent_info

2015-01-25 Thread Chao Yu
Rename a filed name from 'blk_addr' to 'blk' in struct {f2fs_extent,extent_info} as annotation of this field descripts its meaning well to us. By this way, we can avoid long statement in code of following patches. Signed-off-by: Chao Yu chao2...@samsung.com --- fs/f2fs/data.c | 13

[f2fs-dev] [PATCH v2 08/10] f2fs: enable rb-tree extent cache

2015-01-25 Thread Chao Yu
This patch enables rb-tree based extent cache in f2fs. When we mount with -o extent_cache, f2fs will try to add recently accessed page-block mappings into rb-tree based extent cache as much as possible, instead of original one extent info cache. By this way, f2fs can support more effective cache

[f2fs-dev] [PATCH v2 07/10] f2fs: add a mount option for rb-tree extent cache

2015-01-25 Thread Chao Yu
This patch adds a mount option 'extent_cache' in f2fs. It tries to use a rb-tree based extent cache to cache more mapping information with less memory if this option is set, otherwise we will use the original one extent info cache. Suggested-by: Changman Lee cm224@samsung.com Signed-off-by:

[f2fs-dev] [PATCH v2 10/10] f2fs: add trace for rb-tree extent cache ops

2015-01-25 Thread Chao Yu
This patch adds trace for lookup/update/shrink/destroy ops in rb-tree extent cache. Signed-off-by: Chao Yu chao2...@samsung.com --- fs/f2fs/data.c | 16 +- include/trace/events/f2fs.h | 134 2 files changed, 148 insertions(+), 2

[f2fs-dev] [PATCH v2 09/10] f2fs: show extent tree, node stat info in debugfs

2015-01-25 Thread Chao Yu
This patch adds and shows stat info of total memory footprint for extent tree, node in debugfs. Signed-off-by: Chao Yu chao2...@samsung.com --- fs/f2fs/debug.c | 7 +++ fs/f2fs/f2fs.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c

[f2fs-dev] [PATCH v2 05/10] f2fs: introduce infra macro and data structure of rb-tree extent cache

2015-01-25 Thread Chao Yu
Introduce infra macro and data structure for rb-tree based extent cache: Macros: * EXT_TREE_VEC_SIZE: indicate vector size for gang lookup in extent tree. * F2FS_MIN_EXTENT_LEN: indicate minimum length of extent managed in cache. * EXTENT_CACHE_SHRINK_NUMBER: indicate number of extent in cache

[f2fs-dev] [PATCH v2 06/10] f2fs: add core functions for rb-tree extent cache

2015-01-25 Thread Chao Yu
This patch adds core functions including slab cache init function and init/lookup/update/shrink/destroy function for rb-tree based extent cache. Thank Jaegeuk Kim and Changman Lee as they gave much suggestion about detail design and implementation of extent cache. Todo: * add a cached_ei into