linux-kernel-test/fs/f2fs
Jaegeuk Kim b7250d2d84 f2fs: fix calculation of max. gc cost in the SSR case
In the SSR case, the max gc cost should be the number of pages in a segment.
Otherwise, f2fs is able to fail getting dirty segments frequently for SSR.

In get_victim_by_default() previously,

while(1) {
   ...
   cost = get_gc_cost(); <- cost is between 0 ~ 512.
   ...
   if (cost == get_max_cost(sbi, &p)) <- max cost is UINT_MAX due to GC_CB type
	continue;

   if (nsearched++ >= MAX_VICTIM_SEARCH)
	break;
}

So, if there are a number of fully valid segments in series, f2fs cannot skip
those segments by comparing the cost and max cost of each segment.

Note that, the cost is the number of valid blocks at the time of the last
checkpoint.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-02-12 07:15:02 +09:00
..
acl.c f2fs: avoid null dereference in f2fs_acl_from_disk 2013-01-04 09:46:27 +09:00
acl.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
checkpoint.c f2fs: clarify and enhance the f2fs_gc flow 2013-02-12 07:15:02 +09:00
data.c f2fs: support swapfile 2013-01-22 10:48:58 +09:00
debug.c f2fs: add device name in debugfs 2013-02-12 07:15:01 +09:00
dir.c f2fs: avoid redundant time update for parent directory in f2fs_delete_entry 2013-01-14 09:43:27 +09:00
f2fs.h f2fs: clarify and enhance the f2fs_gc flow 2013-02-12 07:15:02 +09:00
file.c f2fs: stop repeated checking if cp is needed 2013-02-12 07:15:01 +09:00
gc.c f2fs: fix calculation of max. gc cost in the SSR case 2013-02-12 07:15:02 +09:00
gc.h f2fs: clarify and enhance the f2fs_gc flow 2013-02-12 07:15:02 +09:00
hash.c f2fs: unify string length declarations and usage 2012-12-28 11:27:53 +09:00
inode.c f2fs: avoid balanc_fs during evict_inode 2013-02-12 07:15:01 +09:00
Kconfig f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
Makefile f2fs: update Kconfig and Makefile 2012-12-11 13:43:42 +09:00
namei.c f2fs: unify string length declarations and usage 2012-12-28 11:27:53 +09:00
node.c f2fs: clarify and enhance the f2fs_gc flow 2013-02-12 07:15:02 +09:00
node.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
recovery.c f2fs: clarify and enhance the f2fs_gc flow 2013-02-12 07:15:02 +09:00
segment.c f2fs: clarify and enhance the f2fs_gc flow 2013-02-12 07:15:02 +09:00
segment.h f2fs: clarify and enhance the f2fs_gc flow 2013-02-12 07:15:02 +09:00
super.c f2fs: clarify and enhance the f2fs_gc flow 2013-02-12 07:15:02 +09:00
xattr.c f2fs: add f2fs_balance_fs in several interfaces 2013-01-11 15:09:17 +09:00
xattr.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00