Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

f2fs: fix to return SHRINK_EMPTY if no objects to free

Quoted from include/linux/shrinker.h
"count_objects should return the number of freeable items in the cache. If
there are no objects to free, it should return SHRINK_EMPTY, while 0 is
returned in cases of the number of freeable items cannot be determined
or shrinker should skip this cache for this time (e.g., their number
is below shrinkable limit)."

Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Zhiguo Niu and committed by
Jaegeuk Kim
bd409934 eb85c241

+1 -1
+1 -1
fs/f2fs/shrinker.c
··· 73 73 mutex_unlock(&sbi->umount_mutex); 74 74 } 75 75 spin_unlock(&f2fs_list_lock); 76 - return count; 76 + return count ?: SHRINK_EMPTY; 77 77 } 78 78 79 79 unsigned long f2fs_shrink_scan(struct shrinker *shrink,