block/024 works in a way that, if we submit N bio requests and each bio
requests will consume M ns, then the total time consumed should be
(N * M) ns.
However there may be some merging of write bio requests, and thus the value
of the "write ticks" filed of "/sys/block/<dev>/stat" may be less than
what we expect.
For example, running the following script,
```sh
modprobe -r null_blk
modprobe null_blk queue_mode=2 irqmode=2 completion_nsec=500000
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
cat /sys/block/nullb0/stat
```
and we get output
```
1 0 8 0 2626 411 28800 1388
0 943 1444 0 0 0 0
```
In this case, we submit 3600 (1800 * 2) write bio requests, among which 411 bio
requests
are merged (2626 + 411 * 2 = 3448).
Thus we need to disable the merging of bio requests by
```
```
Signed-off-by: Jeffle Xu <[email protected]>
---
tests/block/024 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/block/024 b/tests/block/024
index b40a869..0ffc63f 100755
--- a/tests/block/024
+++ b/tests/block/024
@@ -42,6 +42,9 @@ test() {
return 1
fi
+ # Disable IO request merging
+ echo 2 > /sys/block/nullb0/queue/nomerges
+
init_times
show_times
--
1.8.3.1