]> www.infradead.org Git - users/hch/blktests.git/commitdiff
block/024: Increase I/O time
authorMasato Suzuki <masato.suzuki@wdc.com>
Wed, 20 Feb 2019 08:12:27 +0000 (17:12 +0900)
committerOmar Sandoval <osandov@fb.com>
Wed, 20 Feb 2019 18:19:47 +0000 (10:19 -0800)
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>
tests/block/024

index cf1470709169d01528cedc22c8f4223d11ec8e8b..b40a869ee2d9d172897530d7a34d3af136e3a268 100755 (executable)
@@ -53,9 +53,10 @@ test() {
        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