summaryrefslogtreecommitdiff
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-03-14 08:49:58 +0900
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-03-20 18:30:12 +0900
commit48cb76c7be7056810cdcdcdcd8d90d3fdc4e250f (patch)
tree4213b7ff250913d7a0403466451463784aa8b34e /fs/f2fs/node.c
parent08d8058be6d11bd81f2ed75fc0ecdf55b7685655 (diff)
f2fs: scan next nat page to reuse free nids in there
When we build new free nids, let's scan the just next NAT page instead of skipping a couple of previously scanned pages in order to reuse free nids in there. Otherwise, we can use too much wide range of nids even though several nids were deallocated, and also their node pages can be cached in the node_inode's address space. This means that we can retain lots of clean pages in the main memory, which induces mm's reclaiming overhead. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 90221cc7247c..94951d9aff4c 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1317,7 +1317,8 @@ static void build_free_nids(struct f2fs_sb_info *sbi)
break;
}
- nm_i->next_scan_nid = nid;
+ /* go to the next nat page in order to reuse free nids first */
+ nm_i->next_scan_nid = nm_i->init_scan_nid + NAT_ENTRY_PER_BLOCK;
/* find free nids from current sum_pages */
mutex_lock(&curseg->curseg_mutex);