filesetup: don't track file allocation for jobs == 1
authorJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 18:37:14 +0000 (12:37 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 18:37:14 +0000 (12:37 -0600)
commit084a5475d55b6cad7550e56a46d8797e8534bb2d
tree99000be6a836251f9c21eba30f2225061ad5d148
parent132b1ee42e63a5ca369d94d33d2a7337741d7458
filesetup: don't track file allocation for jobs == 1

We only really need this for multiple jobs, and we only check it
if we are in job > 1. But we always mark the file as allocated.
For jobs with lots of files (millions), this takes a long time
to do at setup time.

Running this sample job:

./fio --alloc-size=131072 --name=filecreate --ioengine=filecreate --size=1g --nr_files=1m --openfiles=256

takes ~16s before, and about ~7s afterwards.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
filesetup.c