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

f2fs: readahead for free nids building

When there is no free nid in nid cache, all new node allocaters stop their
job to wait for reloading of free nids, however reloading is synchronous as
we will read 4 NAT pages for building nid cache, it cause the long latency.

This patch tries to readahead more NAT pages with READA request flag after
reloading of free nids. It helps to improve performance when users allocate
node id intensively.

Env: Sandisk 32G sd card
time for i in `seq 1 60000`; { echo -n > /mnt/f2fs/$i; echo XXXXXX > /mnt/f2fs/$i;}

Before:
real 0m2.814s
user 0m1.220s
sys 0m1.536s

After:
real 0m2.711s
user 0m1.136s
sys 0m1.568s

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
2db2388f 26879fb1

+3
+3
fs/f2fs/node.c
··· 1560 1560 remove_free_nid(nm_i, nid); 1561 1561 } 1562 1562 mutex_unlock(&curseg->curseg_mutex); 1563 + 1564 + ra_meta_pages(sbi, NAT_BLOCK_OFFSET(nm_i->next_scan_nid), 1565 + FREE_NID_PAGES, META_NAT, false); 1563 1566 } 1564 1567 1565 1568 /*