Fix read/write mix and different levels of randomness
authorJens Axboe <axboe@fb.com>
Mon, 15 Dec 2014 02:01:24 +0000 (19:01 -0700)
committerJens Axboe <axboe@fb.com>
Mon, 15 Dec 2014 02:01:24 +0000 (19:01 -0700)
commitf1dfb6682460b70d50a87fca49d077edde136072
treea89c5b7d48cf9049c3e7f718abb65fae03490408
parent66b6c5efc84f1a5fb25648f38409716682bad84c
Fix read/write mix and different levels of randomness

Stephen reports:

When using fio configuration below:

[global]
ioengine=libaio
direct=1
runtime=600
bs=32k
iodepth=8
rw=randrw
rwmixread=80
percentage_random=100,0

[drive1]
filename=/dev/sda

I am expecting to see 80% reads, 20% writes where all reads are random
and all writes are sequential. I captured a bus trace of traffic to the
disk and the bus trace reflected as much with one issue. The write
commands are essentially random. Each write begins at a new random LBA.
If 2 or more writes occur in a row, the LBA's are sequential based on
the block size BUT I feel the heart of this feature would be to emulate
a large file write during random access. With that in mind would it be
possible for sequential reads or writes within mixed sequential/random
workload to remember the last LBA accessed? In this scenario the writes
would still only take up 20% of the workload but when a write did occur
it should be the next sequential step from the last write.

-----

This is due to the fact that fio tracks last start/end on a unified
basis, not per read/write/trim direction. Fix that.

Signed-off-by: Jens Axboe <axboe@fb.com>
file.h
filesetup.c
io_u.c