summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/shrinker.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-06-17 01:41:49 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2016-07-06 19:44:08 +0200
commitad4edb83143fdeef9e6fdd9daaa735b59476565b (patch)
treec2691e320b927f9dce1ae9df62875f3123f908d9 /fs/f2fs/shrinker.c
parentf2fs: detect host-managed SMR by feature flag (diff)
downloadlinux-ad4edb83143fdeef9e6fdd9daaa735b59476565b.tar.xz
linux-ad4edb83143fdeef9e6fdd9daaa735b59476565b.zip
f2fs: produce more nids and reduce readahead nats
The readahead nat pages are more likely to be reclaimed quickly, so it'd better to gather more free nids in advance. And, let's keep some free nids as much as possible. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/shrinker.c')
-rw-r--r--fs/f2fs/shrinker.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/shrinker.c b/fs/f2fs/shrinker.c
index 93606f281bf9..46c915425923 100644
--- a/fs/f2fs/shrinker.c
+++ b/fs/f2fs/shrinker.c
@@ -13,6 +13,7 @@
#include <linux/f2fs_fs.h>
#include "f2fs.h"
+#include "node.h"
static LIST_HEAD(f2fs_list);
static DEFINE_SPINLOCK(f2fs_list_lock);
@@ -25,8 +26,8 @@ static unsigned long __count_nat_entries(struct f2fs_sb_info *sbi)
static unsigned long __count_free_nids(struct f2fs_sb_info *sbi)
{
- if (NM_I(sbi)->fcnt > NAT_ENTRY_PER_BLOCK)
- return NM_I(sbi)->fcnt - NAT_ENTRY_PER_BLOCK;
+ if (NM_I(sbi)->fcnt > MAX_FREE_NIDS)
+ return NM_I(sbi)->fcnt - MAX_FREE_NIDS;
return 0;
}