time_based: Avoid restarting main I/O loop
authorDaniel Ehrenberg <dehrenberg@google.com>
Fri, 16 Mar 2012 17:54:15 +0000 (18:54 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 16 Mar 2012 17:54:15 +0000 (18:54 +0100)
commitc04e4661e4da3b6079f415897e4507cf8e610c54
treedeee9d88eb2c69c6fd001e3128bcea9b82cbae6f
parent8a74b56d7aef44ea75d7abf910ad75378b438fe3
time_based: Avoid restarting main I/O loop

Previously, when fio had written a volume of I/O equal to the size
argument, it restarted the main do_io loop.

This patch allows time_based tests to be run for longer than one
cycle in the do_io main loop. This has a couple of advantages:
 * The random number generator is not reset on each iteration
   of the loop, so running longer will reach different locations.
 * There is not a throughput-reducing point where all operations
   must be reaped before new operations are submitted.

The implementation consists of two minor changes:
 * In the do_io loop, a time_based test will not exit the loop for
   reading or writing too much data.
 * When reading or writing sequentially, the operations wrap around
   to the beginning after reading the end within the
   get_next_seq_block function.

Modified by Jens to properly restart when using a randommap
as well.

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