]> git.karo-electronics.de Git - karo-tx-linux.git/commit
f2fs: expose f2fs_write_cache_pages
authorChao Yu <chao2.yu@samsung.com>
Tue, 14 Jul 2015 10:56:10 +0000 (18:56 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 4 Aug 2015 21:09:59 +0000 (14:09 -0700)
commit8f46dcaea8d9d1552f4071f1ddeeca4427c1d83a
tree58d2980c6bb748e7992b665f61b9fa3100aeaf45
parent037fe70c9a6cebe11ae13402994b844e907ebe0c
f2fs: expose f2fs_write_cache_pages

If there are gced dirty pages and normal dirty pages in the mapping
of one inode, we might writeback them alternately with discontinuous
block address, resulting in low performance.

This patch introduces f2fs_write_cache_pages with codes copied from
write_cache_pages in mm/page-writeback.c.

In this function, we refactor flow with two steps:
1) writeback all cold type pages.
2) writeback all non-cold type pages.

By using this method, f2fs will writeback dirty pages with the same
temperature in bunch mode, it makes writeouted block being with
more continuous address, so they can be merged as much as possible
in f2fs bio cache, and also it will reduce the chance of submiting
small IO from block layer.

Test environment: 8g nokia sd card (very old sd card, but it shows
better effect when testing with this patch, and with a 32g kingston
sd card, I didn't see much more improvement).

Test step:
1. touch testfile;
2. truncate -s 512K testfile;
3. write all pages with odd index;
4. trigger gc by ioctl;
5. write all pages with even index;
6. time fsync testfile.

before:
real 0m0.402s
user 0m0.000s
sys 0m0.000s

after:
real 0m0.143s
user 0m0.004s
sys 0m0.004s

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