Skip to content

Commit

Permalink
f2fs: scan next nat page to reuse free nids in there
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jaegeuk Kim committed Mar 20, 2013
1 parent 08d8058 commit 48cb76c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/f2fs/node.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 48cb76c

Please sign in to comment.