f2fs: support in batch multi blocks preallocation
authorChao Yu <yuchao0@huawei.com>
Mon, 9 May 2016 11:56:30 +0000 (19:56 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 11 May 2016 16:56:35 +0000 (09:56 -0700)
commit46008c6d42328710f9beaf5c2b47dc92b1cc1a75
treede93d87eaf6b9a77d97378fd5dea31d2990129e2
parent0fac558b96584799876498248020dc49a98bd131
f2fs: support in batch multi blocks preallocation

This patch introduces reserve_new_blocks to make preallocation of multi
blocks as in batch operation, so it can avoid lots of redundant
operation, result in better performance.

In virtual machine, with rotational device:

time fallocate -l 32G /mnt/f2fs/file

Before:
real 0m4.584s
user 0m0.000s
sys 0m4.580s

After:
real 0m0.292s
user 0m0.000s
sys 0m0.272s

In x86, with SSD:

time fallocate -l 500G $MNT/testfile

Before : 24.758 s
After  :  1.604 s

Signed-off-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: fix bugs and add performance numbers measured in x86.]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h
include/trace/events/f2fs.h