genfio: Warn users if read occurs before write
authorErwan Velu <erwan@enovance.com>
Fri, 12 Jul 2013 13:21:25 +0000 (15:21 +0200)
committerErwan Velu <erwan@enovance.com>
Fri, 12 Jul 2013 13:28:27 +0000 (15:28 +0200)
commit60238f0e7c8bb689f31e3871a661741f2c5fd583
tree44bbda92f2e1e7479410d7dc5857a0147ab4f9ad
parentab65293105d2198b4180b7ded01f8307e9b4a45c
genfio: Warn users if read occurs before write

The default mode was to generate read pattern _before_ the write ones.
On some storage device that handle read on untouch sectors by answering
zero from the cache, the result is totally invalid and cheat about the
real read capabilities of the device.

This patch does change the default mode to emit writes before reads.
It also add a warning message if user is setting up some modes by itself
and generate a read_before_write pattern.

That's only a warning message that last a few seconds but could avoid
running a wrong benchmark.

This commit occurs after a real case of invalid performances due to read
emitted to an untouched block volume.

Typical output will be:
 root@vm1-1: genfio -d vdb -s -b 4k,128k,4m -m read,randread
 ###############################################################
 # Warning : You are reading data while never wrote them before#
 # On some storage devices, this could lead to invalid results #
 #                                                             #
 # Press Ctrl-C to adjust pattern order if you have doubts     #
 # Or Wait 5 seconds before the file will be created           #
 ###############################################################
 Generating vm1-1-4k,128k,4m-sequential-read,randread-vdb.fio
 Estimated Time = 1800 seconds : 0 hour 30 minutes
tools/genfio