iotests: 077: Filter out 'resume' lines
PATCH 1/1 iotests: 077: Filter out 'resume' lines
In the "Overlapping multiple requests" cases, the 3rd reqs (the break point B) doesn't wait for the 2nd, and once resumed the I/O will just continue. This is because the 2nd is already waiting for the 1st, and in wait_serialising_requests() there is:
/* If the request is already (indirectly) waiting for us, or
* will wait for us as soon as it wakes up, then just go on
* (instead of producing a deadlock in the former case). */
if (!req->waiting_for) {
/* actually break */
...
}Consequently, the following "sleep 100; resume A" command races with the completion of that request, and sometimes results in an unexpected order of output:
Review line 64
Quoted 11 lines
(quoted diff) +1
-1@@ -56,9 +56,9 @@ wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Resuming request 'B' +blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX
Filter out the "Resuming request" lines to make the output deterministic.
--- tests/qemu-iotests/077 | 3 ++- tests/qemu-iotests/077.out | 48 ++++++++++++++++------------------------------ 2 files changed, 18 insertions(+), 33 deletions(-)
tests/qemu-iotests/077 +2 -1
@@ -188,7 +188,8 @@ EOF test_io | $QEMU_IO | _filter_qemu_io | \ sed -e 's,[0-9/]* bytes at offset [0-9]*,XXX/XXX bytes at offset XXX,g' \ -e 's/^[0-9]* \(bytes\|KiB\)/XXX bytes/' \ - -e '/Suspended/d' + -e '/Suspended/d' \ + -e '/blkdebug: Resuming request/d' echo echo "== Verify image content =="
tests/qemu-iotests/077.out +16 -32
84 lines not on this page · raw message
Signature · 1 line
2.13.6
Quoted 9 lines · Fam Zheng
In the "Overlapping multiple requests" cases, the 3rd reqs (the break point B) doesn't wait for the 2nd, and once resumed the I/O will just continue. This is because the 2nd is already waiting for the 1st, and in
wait_serialising_requests()there is:Filter out the "Resuming request" lines to make the output deterministic.
Quoted 7 lines
Reported-by Patchew <[email protected]>Signed-off-by Fam Zheng <[email protected]>--- tests/qemu-iotests/077 | 3 ++- tests/qemu-iotests/077.out | 48 ++++++++++++++++------------------------------ 2 files changed, 18 insertions(+), 33 deletions(-)
Quoted 5 lines
tests/qemu-iotests/077.out +0
-1@@ -4,17 +4,6 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 == Some concurrent requests involving RMW == wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A'
tests/qemu-iotests/077.out Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 · line 17
Quoted 10 lines
tests/qemu-iotests/077.out +0
-10-wrote XXX/XXX bytes at offset XXX -XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote XXX/XXX bytes at offset XXX -XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' -wrote XXX/XXX bytes at offset XXX -XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote XXX/XXX bytes at offset XXX -XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A'
git diff does a really lousy job of displaying this one, but the end result looks correct.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Max Reitz
AppliedQuoted 32 lines · Fam Zheng
In the "Overlapping multiple requests" cases, the 3rd reqs (the break point B) doesn't wait for the 2nd, and once resumed the I/O will just continue. This is because the 2nd is already waiting for the 1st, and in
wait_serialising_requests()there is:/* If the request is already (indirectly) waiting for us, or * will wait for us as soon as it wakes up, then just go on * (instead of producing a deadlock in the former case). */ if (!req->waiting_for) { /* actually break */ ... }Consequently, the following "sleep 100; resume A" command races with the completion of that request, and sometimes results in an unexpected order of output:
tests/qemu-iotests/077.out wrote XXX/XXX bytes at offset XXX · line 64
Quoted 11 lines
tests/qemu-iotests/077.out +1
-1@@ -56,9 +56,9 @@ wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Resuming request 'B' +blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXXFilter out the "Resuming request" lines to make the output deterministic.
Quoted 6 lines
Reported-by Patchew <[email protected]>Signed-off-by Fam Zheng <[email protected]>--- tests/qemu-iotests/077 | 3 ++- tests/qemu-iotests/077.out | 48 ++++++++++++++++------------------------------ 2 files changed, 18 insertions(+), 33 deletions(-)
Thanks, applied to my block tree:
https://github.com/XanClic/qemu/commits/block
Max