diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-07-28 18:33:46 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-20 09:00:06 -0700 |
commit | 31696580bf4c042a0f7b06d855e04441488d18b1 (patch) | |
tree | 33904342d5332881fc6ffc925dbcb294c8ed87e4 /fs/f2fs/segment.c | |
parent | 206e61be29624499af46546076e835da93e6bde5 (diff) | |
download | blackbird-obmc-linux-31696580bf4c042a0f7b06d855e04441488d18b1.tar.gz blackbird-obmc-linux-31696580bf4c042a0f7b06d855e04441488d18b1.zip |
f2fs: shrink free_nids entries
This patch introduces __count_free_nids/try_to_free_nids and registers
them in slab shrinker for shrinking under memory pressure.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index bf1605dbce93..1b4265639f07 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -310,6 +310,9 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi) if (!available_free_memory(sbi, NAT_ENTRIES)) try_to_free_nats(sbi, NAT_ENTRY_PER_BLOCK); + if (!available_free_memory(sbi, FREE_NIDS)) + try_to_free_nids(sbi, NAT_ENTRY_PER_BLOCK * FREE_NID_PAGES); + /* checkpoint is the only way to shrink partial cached entries */ if (!available_free_memory(sbi, NAT_ENTRIES) || excess_prefree_segs(sbi) || |