The total time spent on write I/Os for the 3 dd executions will be at most
1500 * 3 * 0.5ms = 2250ms, that is, 2.25s. Due to system overhead and
timer triggers, a total write I/O time larger than this value is generally
reported through I/O stat. However, for a system with very low overhead
and/or very precise timers, the reported value can be under 2.5s, leading
to a rounded value equal to 2s, and not the 3s expected.
To avoid the test to fail due to this problem, increase the number of write
I/Os executed so that the total exact I/O time exceeds 2.5s, leading to a
rounded value equal to 3s. The change increases the number of I/Os of the
second and third dd calls to 1800, leading to an exact write I/O time of
(1500 + 1800 * 2) * 0.5 ms = 2.55s.
Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com>
dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1500 status=none
show_times
+ # 1800 * 0.5 ms is 0.9 seconds.
dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1500 status=none &
- dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1500 status=none &
- dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1500 status=none &
+ dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1800 status=none &
+ dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1800 status=none &
wait
show_times