Something odd with the fio random offset generator & time_based runs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While experimenting with some IO loads, I noticed that the random
offset selection wasn't as random as it should be.  I started looking
for something complicated thinking maybe it had to do with large
devices.  But when I took a step back and tried a simpler test, I
found it applied to any size.

Using a random map masks the problem because it is forced to cover all
the offsets.  But for IO loads on large devices with multiple jobs,
random maps aren't useful.

Here's a simple demonstration on Linux.  (Linux only because it uses
the special /proc/self/fd files.  It can work on other OSs by writing
to a normal file or pipe and running the rest of the command on that
file/pipe.)

First, with a random map...
$ ./fio --name=test --rw=randread --iodepth=1 --ioengine=null --thread
--bs=128 --size=1k --runtime=6 --time_based
--write_iolog=/proc/self/fd/1 | grep 'test.1.0 read' | sort | uniq -c
 184946 test.1.0 read 0 128
 184945 test.1.0 read 128 128
 184945 test.1.0 read 256 128
 184946 test.1.0 read 384 128
 184945 test.1.0 read 512 128
 184946 test.1.0 read 640 128
 184945 test.1.0 read 768 128
 184945 test.1.0 read 896 128

As expected, it is pretty evenly spread.  But now without a random map...
$ ./fio --name=test --rw=randread --iodepth=1 --ioengine=null --thread
--bs=128 --size=1k --runtime=6 --time_based --norandommap
--write_iolog=/proc/self/fd/1 | grep 'test.1.0 read' | sort | uniq -c
 188409 test.1.0 read 0 128
 565224 test.1.0 read 256 128
 188408 test.1.0 read 384 128
 565224 test.1.0 read 640 128

Even with a random map, this has an impact.  The offsets which are
favored by the RNG will always be used first, before those unfavored.
Notice that the 3 offsets that got an extra IO were all in the set
returned in the second test.  (Offsets 0, 384 and 640.)

This is not a new regression either.  I tried using the OS random flag...
$ ./fio --name=test --rw=randread --iodepth=1 --ioengine=null --thread
--bs=128 --size=1k --runtime=6 --time_based --norandommap
--use_os_rand=1 --write_iolog=/proc/self/fd/1 | grep 'test.1.0 read' |
sort | uniq -c
 558950 test.1.0 read 0 128
 372632 test.1.0 read 384 128
 558949 test.1.0 read 512 128

And when I tried going to an old 1.x release before the random
changes, it was identical to the use_os_rand flag.
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux