* [Qemu-devel] the qemu-iotests test suite is now available @ 2009-06-22 21:05 Christoph Hellwig 2009-06-23 9:16 ` Kevin Wolf 2009-06-23 16:03 ` Anthony Liguori 0 siblings, 2 replies; 15+ messages in thread From: Christoph Hellwig @ 2009-06-22 21:05 UTC (permalink / raw) To: qemu-devel I've now uploaded the qemu-iotests suite which exercises the I/O path using qemu-img, qemu-io and basic qemu use without a guest. It's available from my personal kernel.org area at: git://git.kernel.org/pub/scm/linux/kernel/git/hch/qemu-iotests.git with gitweb at http://git.kernel.org/?p=linux/kernel/git/hch/qemu-iotests.git To run it simply do a ./check (defaults to raw format) or ./check -qcow2. Thanks to Kevin Wolf for sharing his qcow2 test script which make up the most interesting scripts in the test suite, and for SGI for beeing able to re-use the xfsqa test driver. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-22 21:05 [Qemu-devel] the qemu-iotests test suite is now available Christoph Hellwig @ 2009-06-23 9:16 ` Kevin Wolf 2009-06-23 14:31 ` Christoph Hellwig 2009-06-23 16:03 ` Anthony Liguori 1 sibling, 1 reply; 15+ messages in thread From: Kevin Wolf @ 2009-06-23 9:16 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel Christoph Hellwig schrieb: > I've now uploaded the qemu-iotests suite which exercises the I/O > path using qemu-img, qemu-io and basic qemu use without a guest. > > It's available from my personal kernel.org area at: > > git://git.kernel.org/pub/scm/linux/kernel/git/hch/qemu-iotests.git > > with gitweb at > > http://git.kernel.org/?p=linux/kernel/git/hch/qemu-iotests.git > > To run it simply do a ./check (defaults to raw format) or ./check > -qcow2. > > Thanks to Kevin Wolf for sharing his qcow2 test script which make up > the most interesting scripts in the test suite, and for SGI for beeing > able to re-use the xfsqa test driver. Great to see this. Seems I can bury my ad-hoc script soon. :-) About the qcow2 tests there is one thing to note: These test cases use hard coded offsets which were calculated for 4k clusters. For 64k clusters (which the default now) I'm almost sure they don't test the critical points any more. So we'll need to change offsets dynamically depending on the cluster size of the qcow2 image. Kevin ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-23 9:16 ` Kevin Wolf @ 2009-06-23 14:31 ` Christoph Hellwig 2009-06-23 14:36 ` Kevin Wolf 0 siblings, 1 reply; 15+ messages in thread From: Christoph Hellwig @ 2009-06-23 14:31 UTC (permalink / raw) To: Kevin Wolf; +Cc: Christoph Hellwig, qemu-devel On Tue, Jun 23, 2009 at 11:16:21AM +0200, Kevin Wolf wrote: > About the qcow2 tests there is one thing to note: These test cases use > hard coded offsets which were calculated for 4k clusters. For 64k > clusters (which the default now) I'm almost sure they don't test the > critical points any more. So we'll need to change offsets dynamically > depending on the cluster size of the qcow2 image. Or just run the test for all interesting cluster sizes to some more coverage (should be only 4k and 64k for now). ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-23 14:31 ` Christoph Hellwig @ 2009-06-23 14:36 ` Kevin Wolf 2009-06-23 16:41 ` Christoph Hellwig 0 siblings, 1 reply; 15+ messages in thread From: Kevin Wolf @ 2009-06-23 14:36 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel Christoph Hellwig schrieb: > On Tue, Jun 23, 2009 at 11:16:21AM +0200, Kevin Wolf wrote: >> About the qcow2 tests there is one thing to note: These test cases use >> hard coded offsets which were calculated for 4k clusters. For 64k >> clusters (which the default now) I'm almost sure they don't test the >> critical points any more. So we'll need to change offsets dynamically >> depending on the cluster size of the qcow2 image. > > Or just run the test for all interesting cluster sizes to some more > coverage (should be only 4k and 64k for now). We could either always test both 4k and 64k or let the user choose on the command line. Either way, this is unrelated to what I meant. I'm talking about things like this: # Spanning multiple clusters io $op $((offset + 2048)) 8192 12288 64 This is a request spanning multiple 4k clusters, but for 64k clusters it is just another write somewhere in the middle of the cluster. So with 64k we actually have worse coverage currently than with 4k clusters (and we don't test 4k yet). Kevin ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-23 14:36 ` Kevin Wolf @ 2009-06-23 16:41 ` Christoph Hellwig 2009-06-24 7:35 ` Kevin Wolf 2009-07-06 11:18 ` Kevin Wolf 0 siblings, 2 replies; 15+ messages in thread From: Christoph Hellwig @ 2009-06-23 16:41 UTC (permalink / raw) To: Kevin Wolf; +Cc: Christoph Hellwig, qemu-devel On Tue, Jun 23, 2009 at 04:36:29PM +0200, Kevin Wolf wrote: > Christoph Hellwig schrieb: > > On Tue, Jun 23, 2009 at 11:16:21AM +0200, Kevin Wolf wrote: > >> About the qcow2 tests there is one thing to note: These test cases use > >> hard coded offsets which were calculated for 4k clusters. For 64k > >> clusters (which the default now) I'm almost sure they don't test the > >> critical points any more. So we'll need to change offsets dynamically > >> depending on the cluster size of the qcow2 image. > > > > Or just run the test for all interesting cluster sizes to some more > > coverage (should be only 4k and 64k for now). > > We could either always test both 4k and 64k or let the user choose on > the command line. Either way, this is unrelated to what I meant. I'm > talking about things like this: > > # Spanning multiple clusters > io $op $((offset + 2048)) 8192 12288 64 > > This is a request spanning multiple 4k clusters, but for 64k clusters it > is just another write somewhere in the middle of the cluster. So with > 64k we actually have worse coverage currently than with 4k clusters (and > we don't test 4k yet). Yes, that needs updates for the 64k clusters. Do you already have an updated version? If not I'll walk through it once I'm done here with FISL. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-23 16:41 ` Christoph Hellwig @ 2009-06-24 7:35 ` Kevin Wolf 2009-07-06 11:18 ` Kevin Wolf 1 sibling, 0 replies; 15+ messages in thread From: Kevin Wolf @ 2009-06-24 7:35 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel Christoph Hellwig schrieb: > On Tue, Jun 23, 2009 at 04:36:29PM +0200, Kevin Wolf wrote: >> Christoph Hellwig schrieb: >>> On Tue, Jun 23, 2009 at 11:16:21AM +0200, Kevin Wolf wrote: >>>> About the qcow2 tests there is one thing to note: These test cases use >>>> hard coded offsets which were calculated for 4k clusters. For 64k >>>> clusters (which the default now) I'm almost sure they don't test the >>>> critical points any more. So we'll need to change offsets dynamically >>>> depending on the cluster size of the qcow2 image. >>> Or just run the test for all interesting cluster sizes to some more >>> coverage (should be only 4k and 64k for now). >> We could either always test both 4k and 64k or let the user choose on >> the command line. Either way, this is unrelated to what I meant. I'm >> talking about things like this: >> >> # Spanning multiple clusters >> io $op $((offset + 2048)) 8192 12288 64 >> >> This is a request spanning multiple 4k clusters, but for 64k clusters it >> is just another write somewhere in the middle of the cluster. So with >> 64k we actually have worse coverage currently than with 4k clusters (and >> we don't test 4k yet). > > Yes, that needs updates for the 64k clusters. Do you already have an > updated version? If not I'll walk through it once I'm done here with > FISL. No, not yet. If you like I can try to patch it in, but maybe at this point you know best how options like varying cluster size fit best in the code. Don't know how much you care about your design. ;-) Kevin ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-23 16:41 ` Christoph Hellwig 2009-06-24 7:35 ` Kevin Wolf @ 2009-07-06 11:18 ` Kevin Wolf 2009-07-06 17:36 ` Christoph Hellwig 1 sibling, 1 reply; 15+ messages in thread From: Kevin Wolf @ 2009-07-06 11:18 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel [-- Attachment #1: Type: text/plain, Size: 2276 bytes --] Christoph Hellwig schrieb: > On Tue, Jun 23, 2009 at 04:36:29PM +0200, Kevin Wolf wrote: >> Christoph Hellwig schrieb: >>> On Tue, Jun 23, 2009 at 11:16:21AM +0200, Kevin Wolf wrote: >>>> About the qcow2 tests there is one thing to note: These test cases use >>>> hard coded offsets which were calculated for 4k clusters. For 64k >>>> clusters (which the default now) I'm almost sure they don't test the >>>> critical points any more. So we'll need to change offsets dynamically >>>> depending on the cluster size of the qcow2 image. >>> Or just run the test for all interesting cluster sizes to some more >>> coverage (should be only 4k and 64k for now). >> We could either always test both 4k and 64k or let the user choose on >> the command line. Either way, this is unrelated to what I meant. I'm >> talking about things like this: >> >> # Spanning multiple clusters >> io $op $((offset + 2048)) 8192 12288 64 >> >> This is a request spanning multiple 4k clusters, but for 64k clusters it >> is just another write somewhere in the middle of the cluster. So with >> 64k we actually have worse coverage currently than with 4k clusters (and >> we don't test 4k yet). > > Yes, that needs updates for the 64k clusters. Do you already have an > updated version? If not I'll walk through it once I'm done here with > FISL. I'm sure there was a mail from you with a lengthy patch... Thunderbird seems to have killed it when trying to answer it, so I'm answering the wrong mail now. They should really use a more recent qcow2 version. ;-) I started to implement this, too. I'm attaching the current state of my version. It's not as complete (converts only io_test() and doesn't even enable different cluster sizes in the tests), but it's a pure 1:1 conversion and it remains compatible with the old test results which is a hint that it's right at least for 4k clusters. I haven't reviewed your patch in much detail, but I think my patch is more correct at least for the "spanning multiple L2 tables" case where you still use the old hard coded numbers. With 4k clusters an L2 table spans 2 MB, whereas with 64k clusters it spans 512 MB. So maybe you just compare the two versions and take for each line whatever looks better suited for dynamic cluster sizes. Kevin [-- Attachment #2: 0001-qemu-iotests-Allow-varying-cluster-sizes-in-io_test.patch --] [-- Type: text/plain, Size: 2815 bytes --] >From ddacd8285b140427ced9b61c5a74e47ed1d067b6 Mon Sep 17 00:00:00 2001 From: Kevin Wolf <kwolf@redhat.com> Date: Fri, 3 Jul 2009 16:21:12 +0200 Subject: [PATCH] qemu-iotests: Allow varying cluster sizes in io_test() The offsets for qemu-io test requests in io_test() are meant to touch different cases in the cluster allocation. To actually test what they are meant for, the cluster size the tests assume and the actual cluster size of the image must match. Currently, the offsets are calculated to fit 4k clusters. This patch introduces a CLUSTER_SIZE variable and makes the offset calculation dependent on the cluster size, allowing varying cluster sizes. If the variable is not set, the default is still 4k. Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- common.pattern | 34 ++++++++++++++++++++-------------- 1 files changed, 20 insertions(+), 14 deletions(-) diff --git a/common.pattern b/common.pattern index f1b1829..4178c0b 100644 --- a/common.pattern +++ b/common.pattern @@ -51,30 +51,36 @@ function io_test() { local op=$1 local offset=$2 - # Complete clusters (size = 4k) - io $op $offset 4096 4096 256 - offset=$((offset + 256 * 4096)) + if [ -z "$CLUSTER_SIZE" ]; then + CLUSTER_SIZE=4096 + fi + + quarter=$((CLUSTER_SIZE / 4)) + l2_size=$((CLUSTER_SIZE * CLUSTER_SIZE / 8)) + + # Complete clusters + io $op $offset $CLUSTER_SIZE $CLUSTER_SIZE 256 + offset=$((offset + 256 * CLUSTER_SIZE)) # From somewhere in the middle to the end of a cluster - io $op $((offset + 2048)) 2048 4096 256 - offset=$((offset + 256 * 4096)) + io $op $((offset + 2 * quarter)) $((2 * quarter)) $CLUSTER_SIZE 256 + offset=$((offset + 256 * CLUSTER_SIZE)) # From the start to somewhere in the middle of a cluster - io $op $offset 2048 4096 256 - offset=$((offset + 256 * 4096)) + io $op $offset $((2 * quarter)) $CLUSTER_SIZE 256 + offset=$((offset + 256 * CLUSTER_SIZE)) # Completely misaligned (and small) - io $op $((offset + 1024)) 2048 4096 256 - offset=$((offset + 256 * 4096)) + io $op $((offset + quarter)) $((2 * quarter)) $CLUSTER_SIZE 256 + offset=$((offset + 256 * CLUSTER_SIZE)) # Spanning multiple clusters - io $op $((offset + 2048)) 8192 12288 64 - offset=$((offset + 64 * 12288)) + io $op $((offset + 2 * quarter)) $((2 * CLUSTER_SIZE)) $((3 * CLUSTER_SIZE)) 64 + offset=$((offset + 64 * 3 * CLUSTER_SIZE)) # Spanning multiple L2 tables - # L2 table size: 512 clusters of 4k = 2M - io $op $((offset + 2048)) 4194304 4999680 8 - offset=$((offset + 8 * 4999680)) + io $op $((offset + 2 * quarter)) $((2 * l2_size)) $((2 * l2_size + 512 * 1573)) 8 + offset=$((offset + 8 * (2 * l2_size + 512 * 1573) )) if false; then true -- 1.6.0.6 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-07-06 11:18 ` Kevin Wolf @ 2009-07-06 17:36 ` Christoph Hellwig 2009-07-07 7:30 ` Kevin Wolf 2009-09-11 14:04 ` Kevin Wolf 0 siblings, 2 replies; 15+ messages in thread From: Christoph Hellwig @ 2009-07-06 17:36 UTC (permalink / raw) To: Kevin Wolf; +Cc: Christoph Hellwig, qemu-devel On Mon, Jul 06, 2009 at 01:18:04PM +0200, Kevin Wolf wrote: > I started to implement this, too. I'm attaching the current state of my > version. It's not as complete (converts only io_test() and doesn't even > enable different cluster sizes in the tests), but it's a pure 1:1 > conversion and it remains compatible with the old test results which is > a hint that it's right at least for 4k clusters. > > I haven't reviewed your patch in much detail, but I think my patch is > more correct at least for the "spanning multiple L2 tables" case where > you still use the old hard coded numbers. With 4k clusters an L2 table > spans 2 MB, whereas with 64k clusters it spans 512 MB. You're right. > So maybe you just compare the two versions and take for each line > whatever looks better suited for dynamic cluster sizes. Done. Below is a version of my original patch with you l2 cluster size changes incorporate. The problem is that I really uses up tons of disk space for the last test in io_test() for 64k clusters, in fact more than I can make available on the laptop I'm travelling with currently.. Index: qemu-iotests/common.pattern =================================================================== --- qemu-iotests.orig/common.pattern 2009-07-06 16:51:59.072239848 +0200 +++ qemu-iotests/common.pattern 2009-07-06 17:22:34.402241220 +0200 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (C) 2009 Red Hat, Inc. # @@ -50,69 +50,71 @@ function io_zero() { function io_test() { local op=$1 local offset=$2 - - # Complete clusters (size = 4k) - io $op $offset 4096 4096 256 - offset=$((offset + 256 * 4096)) + local cluster_size=$3 + local half_cluster=$((cluster_size / 2)) + local quarter_cluster=$((cluster_size / 4)) + local l2_size=$((cluster_size * cluster_size / 8)) + + # Complete clusters + io $op $offset $cluster_size $cluster_size 256 + offset=$((offset + 256 * $cluster_size)) # From somewhere in the middle to the end of a cluster - io $op $((offset + 2048)) 2048 4096 256 - offset=$((offset + 256 * 4096)) + io $op $((offset + $half_cluster)) $half_cluster $cluster_size 256 + offset=$((offset + 256 * $cluster_size)) # From the start to somewhere in the middle of a cluster - io $op $offset 2048 4096 256 - offset=$((offset + 256 * 4096)) + io $op $offset $half_cluster $cluster_size 256 + offset=$((offset + 256 * $cluster_size)) # Completely misaligned (and small) - io $op $((offset + 1024)) 2048 4096 256 - offset=$((offset + 256 * 4096)) + io $op $((offset + $quarter_cluster)) $half_cluster $cluster_size 256 + offset=$((offset + 256 * $cluster_size)) # Spanning multiple clusters - io $op $((offset + 2048)) 8192 12288 64 - offset=$((offset + 64 * 12288)) + io $op $((offset + $half_cluster)) $((cluster_size * 2)) $((cluster_size * 3)) 64 + offset=$((offset + 64 * 3 * $cluster_size)) # Spanning multiple L2 tables # L2 table size: 512 clusters of 4k = 2M - io $op $((offset + 2048)) 4194304 4999680 8 - offset=$((offset + 8 * 4999680)) - - if false; then - true - fi + io $op $((offset + $half_cluster)) $((2 * l2_size)) 4999680 8 + offset=$((offset + 8 * (2 * l2_size + 512 * 1573))) } function io_test2() { local orig_offset=$1 + local cluster_size=$2 # Pattern (repeat after 9 clusters): - # used - used - free - used - compressed - compressed - free - free - compressed + # used - used - free - used - compressed - compressed - + # free - free - compressed # Write the clusters to be compressed echo === Clusters to be compressed [1] - io_pattern writev $((offset + 4 * 4096)) 4096 $((9 * 4096)) 256 165 + io_pattern writev $((offset + 4 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 echo === Clusters to be compressed [2] - io_pattern writev $((offset + 5 * 4096)) 4096 $((9 * 4096)) 256 165 + io_pattern writev $((offset + 5 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 echo === Clusters to be compressed [3] - io_pattern writev $((offset + 8 * 4096)) 4096 $((9 * 4096)) 256 165 + io_pattern writev $((offset + 8 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 mv $TEST_IMG $TEST_IMG.orig - $QEMU_IMG convert -f qcow2 -O qcow2 -c $TEST_IMG.orig $TEST_IMG + $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c $TEST_IMG.orig $TEST_IMG # Write the used clusters echo === Used clusters [1] - io_pattern writev $((offset + 0 * 4096)) 4096 $((9 * 4096)) 256 165 + io_pattern writev $((offset + 0 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 echo === Used clusters [2] - io_pattern writev $((offset + 1 * 4096)) 4096 $((9 * 4096)) 256 165 + io_pattern writev $((offset + 1 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 echo === Used clusters [3] - io_pattern writev $((offset + 3 * 4096)) 4096 $((9 * 4096)) 256 165 + io_pattern writev $((offset + 3 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 # Read them echo === Read used/compressed clusters - io_pattern readv $((offset + 0 * 4096)) $((2 * 4096)) $((9 * 4096)) 256 165 - io_pattern readv $((offset + 3 * 4096)) $((3 * 4096)) $((9 * 4096)) 256 165 - io_pattern readv $((offset + 8 * 4096)) $((1 * 4096)) $((9 * 4096)) 256 165 + io_pattern readv $((offset + 0 * $cluster_size)) $((2 * $cluster_size)) $((9 * $cluster_size)) 256 165 + io_pattern readv $((offset + 3 * $cluster_size)) $((3 * $cluster_size)) $((9 * $cluster_size)) 256 165 + io_pattern readv $((offset + 8 * $cluster_size)) $((1 * $cluster_size)) $((9 * $cluster_size)) 256 165 echo === Read zeros - io_zero readv $((offset + 2 * 4096)) $((1 * 4096)) $((9 * 4096)) 256 - io_zero readv $((offset + 6 * 4096)) $((2 * 4096)) $((9 * 4096)) 256 + io_zero readv $((offset + 2 * $cluster_size)) $((1 * $cluster_size)) $((9 * $cluster_size)) 256 + io_zero readv $((offset + 6 * $cluster_size)) $((2 * $cluster_size)) $((9 * $cluster_size)) 256 } Index: qemu-iotests/013 =================================================================== --- qemu-iotests.orig/013 2009-07-06 16:51:59.078239705 +0200 +++ qemu-iotests/013 2009-07-06 16:52:04.029389748 +0200 @@ -1,6 +1,6 @@ #!/bin/sh # -# qcow2 pattern test, empty and compressed image +# qcow2 pattern test, empty and compressed image - 4k cluster patterns # # Copyright (C) 2009 Red Hat, Inc. # @@ -47,6 +47,7 @@ _supported_os Linux TEST_OFFSETS="0 4294967296" TEST_OPS="writev read write readv" +CLUSTER_SIZE=4096 _make_test_img 6G @@ -56,7 +57,7 @@ echo for offset in $TEST_OFFSETS; do echo "At offset $offset:" for op in $TEST_OPS; do - io_test $op $offset + io_test $op $offset $CLUSTER_SIZE done _check_test_img done @@ -74,7 +75,7 @@ echo for offset in $TEST_OFFSETS; do echo "With offset $offset:" for op in read readv; do - io_test $op $offset + io_test $op $offset $CLUSTER_SIZE done _check_test_img done @@ -87,7 +88,7 @@ for offset in $TEST_OFFSETS; do offset=$((offset + 512)) echo "With offset $offset:" for op in $TEST_OPS; do - io_test $op $offset + io_test $op $offset $CLUSTER_SIZE done _check_test_img done Index: qemu-iotests/014 =================================================================== --- qemu-iotests.orig/014 2009-07-06 16:51:59.083239854 +0200 +++ qemu-iotests/014 2009-07-06 16:52:04.030397139 +0200 @@ -1,6 +1,7 @@ #!/bin/sh # # qcow2 pattern test, complex patterns including compression and snapshots +# Using patterns for 4k cluster size. # # # Copyright (C) 2009 Red Hat, Inc. @@ -48,13 +49,14 @@ _supported_os Linux TEST_OFFSETS="0 4294967296" TEST_OPS="writev read write readv" +CLUSTER_SIZE=4096 _make_test_img 6G echo "Testing empty image:" for offset in $TEST_OFFSETS; do echo test2: With offset $offset - io_test2 $offset + io_test2 $offset $CLUSTER_SIZE _check_test_img done @@ -64,7 +66,7 @@ for i in `seq 1 3`; do for offset in $TEST_OFFSETS; do echo With snapshot test$i, offset $offset for op in $TEST_OPS; do - io_test $op $offset + io_test $op $offset $CLUSTER_SIZE done _check_test_img done Index: qemu-iotests/group =================================================================== --- qemu-iotests.orig/group 2009-07-06 16:51:59.100239157 +0200 +++ qemu-iotests/group 2009-07-06 16:52:04.434485231 +0200 @@ -22,3 +22,5 @@ 013 rw auto 014 rw auto 015 rw snapshot auto +016 rw auto +017 rw auto ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-07-06 17:36 ` Christoph Hellwig @ 2009-07-07 7:30 ` Kevin Wolf 2009-09-11 14:04 ` Kevin Wolf 1 sibling, 0 replies; 15+ messages in thread From: Kevin Wolf @ 2009-07-07 7:30 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel Christoph Hellwig schrieb: > On Mon, Jul 06, 2009 at 01:18:04PM +0200, Kevin Wolf wrote: >> I started to implement this, too. I'm attaching the current state of my >> version. It's not as complete (converts only io_test() and doesn't even >> enable different cluster sizes in the tests), but it's a pure 1:1 >> conversion and it remains compatible with the old test results which is >> a hint that it's right at least for 4k clusters. >> >> I haven't reviewed your patch in much detail, but I think my patch is >> more correct at least for the "spanning multiple L2 tables" case where >> you still use the old hard coded numbers. With 4k clusters an L2 table >> spans 2 MB, whereas with 64k clusters it spans 512 MB. > > You're right. > >> So maybe you just compare the two versions and take for each line >> whatever looks better suited for dynamic cluster sizes. > > Done. Below is a version of my original patch with you l2 cluster size > changes incorporate. The problem is that I really uses up tons of disk > space for the last test in io_test() for 64k clusters, in fact more than > I can make available on the laptop I'm travelling with currently.. I agree, we shouldn't do it this way. 512 MB is a lot and I've heard some people thinking about increasing the cluster size even more... So this doesn't only take too much disk space but also a huge amount of time for a simple test (crossing the L2 table border). So I think what we should do is to calculate the end of the current L2 table, go back a bit and write a small amount of data, just enough to cross the L2 border. Does that make sense? > # Spanning multiple L2 tables > # L2 table size: 512 clusters of 4k = 2M > - io $op $((offset + 2048)) 4194304 4999680 8 > - offset=$((offset + 8 * 4999680)) > - > - if false; then > - true > - fi offset=$(( ((offset + l2_size - 1) & ~(l2_size - 1)) - (3 * half_cluster) )) > + io $op $((offset + $half_cluster)) $((2 * l2_size)) 4999680 8 > + offset=$((offset + 8 * (2 * l2_size + 512 * 1573))) > } And then write 6 * half_cluster or something like that instead of 2 * l2_size. I guess you also should change 4999680 to something like l2_size + half_cluster, so we always hit an L2 border and test a few different cases. Completely untested, but I think it should work this way. Kevin ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-07-06 17:36 ` Christoph Hellwig 2009-07-07 7:30 ` Kevin Wolf @ 2009-09-11 14:04 ` Kevin Wolf 2009-09-11 18:40 ` Christoph Hellwig 1 sibling, 1 reply; 15+ messages in thread From: Kevin Wolf @ 2009-09-11 14:04 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel Am 06.07.2009 19:36, schrieb Christoph Hellwig: > On Mon, Jul 06, 2009 at 01:18:04PM +0200, Kevin Wolf wrote: >> I started to implement this, too. I'm attaching the current state of my >> version. It's not as complete (converts only io_test() and doesn't even >> enable different cluster sizes in the tests), but it's a pure 1:1 >> conversion and it remains compatible with the old test results which is >> a hint that it's right at least for 4k clusters. >> >> I haven't reviewed your patch in much detail, but I think my patch is >> more correct at least for the "spanning multiple L2 tables" case where >> you still use the old hard coded numbers. With 4k clusters an L2 table >> spans 2 MB, whereas with 64k clusters it spans 512 MB. > > You're right. > >> So maybe you just compare the two versions and take for each line >> whatever looks better suited for dynamic cluster sizes. > > Done. Below is a version of my original patch with you l2 cluster size > changes incorporate. The problem is that I really uses up tons of disk > space for the last test in io_test() for 64k clusters, in fact more than > I can make available on the laptop I'm travelling with currently.. What happened with this patch, Christoph? I just looked at the tests again and found that we're still aligning our test requests for 4k clusters. Kevin > Index: qemu-iotests/common.pattern > =================================================================== > --- qemu-iotests.orig/common.pattern 2009-07-06 16:51:59.072239848 +0200 > +++ qemu-iotests/common.pattern 2009-07-06 17:22:34.402241220 +0200 > @@ -1,4 +1,4 @@ > -#!/bin/sh > +#!/bin/bash > # > # Copyright (C) 2009 Red Hat, Inc. > # > @@ -50,69 +50,71 @@ function io_zero() { > function io_test() { > local op=$1 > local offset=$2 > - > - # Complete clusters (size = 4k) > - io $op $offset 4096 4096 256 > - offset=$((offset + 256 * 4096)) > + local cluster_size=$3 > + local half_cluster=$((cluster_size / 2)) > + local quarter_cluster=$((cluster_size / 4)) > + local l2_size=$((cluster_size * cluster_size / 8)) > + > + # Complete clusters > + io $op $offset $cluster_size $cluster_size 256 > + offset=$((offset + 256 * $cluster_size)) > > # From somewhere in the middle to the end of a cluster > - io $op $((offset + 2048)) 2048 4096 256 > - offset=$((offset + 256 * 4096)) > + io $op $((offset + $half_cluster)) $half_cluster $cluster_size 256 > + offset=$((offset + 256 * $cluster_size)) > > # From the start to somewhere in the middle of a cluster > - io $op $offset 2048 4096 256 > - offset=$((offset + 256 * 4096)) > + io $op $offset $half_cluster $cluster_size 256 > + offset=$((offset + 256 * $cluster_size)) > > # Completely misaligned (and small) > - io $op $((offset + 1024)) 2048 4096 256 > - offset=$((offset + 256 * 4096)) > + io $op $((offset + $quarter_cluster)) $half_cluster $cluster_size 256 > + offset=$((offset + 256 * $cluster_size)) > > # Spanning multiple clusters > - io $op $((offset + 2048)) 8192 12288 64 > - offset=$((offset + 64 * 12288)) > + io $op $((offset + $half_cluster)) $((cluster_size * 2)) $((cluster_size * 3)) 64 > + offset=$((offset + 64 * 3 * $cluster_size)) > > # Spanning multiple L2 tables > # L2 table size: 512 clusters of 4k = 2M > - io $op $((offset + 2048)) 4194304 4999680 8 > - offset=$((offset + 8 * 4999680)) > - > - if false; then > - true > - fi > + io $op $((offset + $half_cluster)) $((2 * l2_size)) 4999680 8 > + offset=$((offset + 8 * (2 * l2_size + 512 * 1573))) > } > > function io_test2() { > local orig_offset=$1 > + local cluster_size=$2 > > # Pattern (repeat after 9 clusters): > - # used - used - free - used - compressed - compressed - free - free - compressed > + # used - used - free - used - compressed - compressed - > + # free - free - compressed > > # Write the clusters to be compressed > echo === Clusters to be compressed [1] > - io_pattern writev $((offset + 4 * 4096)) 4096 $((9 * 4096)) 256 165 > + io_pattern writev $((offset + 4 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 > echo === Clusters to be compressed [2] > - io_pattern writev $((offset + 5 * 4096)) 4096 $((9 * 4096)) 256 165 > + io_pattern writev $((offset + 5 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 > echo === Clusters to be compressed [3] > - io_pattern writev $((offset + 8 * 4096)) 4096 $((9 * 4096)) 256 165 > + io_pattern writev $((offset + 8 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 > > mv $TEST_IMG $TEST_IMG.orig > - $QEMU_IMG convert -f qcow2 -O qcow2 -c $TEST_IMG.orig $TEST_IMG > + $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c $TEST_IMG.orig $TEST_IMG > > # Write the used clusters > echo === Used clusters [1] > - io_pattern writev $((offset + 0 * 4096)) 4096 $((9 * 4096)) 256 165 > + io_pattern writev $((offset + 0 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 > echo === Used clusters [2] > - io_pattern writev $((offset + 1 * 4096)) 4096 $((9 * 4096)) 256 165 > + io_pattern writev $((offset + 1 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 > echo === Used clusters [3] > - io_pattern writev $((offset + 3 * 4096)) 4096 $((9 * 4096)) 256 165 > + io_pattern writev $((offset + 3 * $cluster_size)) $cluster_size $((9 * $cluster_size)) 256 165 > > # Read them > echo === Read used/compressed clusters > - io_pattern readv $((offset + 0 * 4096)) $((2 * 4096)) $((9 * 4096)) 256 165 > - io_pattern readv $((offset + 3 * 4096)) $((3 * 4096)) $((9 * 4096)) 256 165 > - io_pattern readv $((offset + 8 * 4096)) $((1 * 4096)) $((9 * 4096)) 256 165 > + io_pattern readv $((offset + 0 * $cluster_size)) $((2 * $cluster_size)) $((9 * $cluster_size)) 256 165 > + io_pattern readv $((offset + 3 * $cluster_size)) $((3 * $cluster_size)) $((9 * $cluster_size)) 256 165 > + io_pattern readv $((offset + 8 * $cluster_size)) $((1 * $cluster_size)) $((9 * $cluster_size)) 256 165 > > echo === Read zeros > - io_zero readv $((offset + 2 * 4096)) $((1 * 4096)) $((9 * 4096)) 256 > - io_zero readv $((offset + 6 * 4096)) $((2 * 4096)) $((9 * 4096)) 256 > + io_zero readv $((offset + 2 * $cluster_size)) $((1 * $cluster_size)) $((9 * $cluster_size)) 256 > + io_zero readv $((offset + 6 * $cluster_size)) $((2 * $cluster_size)) $((9 * $cluster_size)) 256 > } > Index: qemu-iotests/013 > =================================================================== > --- qemu-iotests.orig/013 2009-07-06 16:51:59.078239705 +0200 > +++ qemu-iotests/013 2009-07-06 16:52:04.029389748 +0200 > @@ -1,6 +1,6 @@ > #!/bin/sh > # > -# qcow2 pattern test, empty and compressed image > +# qcow2 pattern test, empty and compressed image - 4k cluster patterns > # > # Copyright (C) 2009 Red Hat, Inc. > # > @@ -47,6 +47,7 @@ _supported_os Linux > > TEST_OFFSETS="0 4294967296" > TEST_OPS="writev read write readv" > +CLUSTER_SIZE=4096 > > _make_test_img 6G > > @@ -56,7 +57,7 @@ echo > for offset in $TEST_OFFSETS; do > echo "At offset $offset:" > for op in $TEST_OPS; do > - io_test $op $offset > + io_test $op $offset $CLUSTER_SIZE > done > _check_test_img > done > @@ -74,7 +75,7 @@ echo > for offset in $TEST_OFFSETS; do > echo "With offset $offset:" > for op in read readv; do > - io_test $op $offset > + io_test $op $offset $CLUSTER_SIZE > done > _check_test_img > done > @@ -87,7 +88,7 @@ for offset in $TEST_OFFSETS; do > offset=$((offset + 512)) > echo "With offset $offset:" > for op in $TEST_OPS; do > - io_test $op $offset > + io_test $op $offset $CLUSTER_SIZE > done > _check_test_img > done > Index: qemu-iotests/014 > =================================================================== > --- qemu-iotests.orig/014 2009-07-06 16:51:59.083239854 +0200 > +++ qemu-iotests/014 2009-07-06 16:52:04.030397139 +0200 > @@ -1,6 +1,7 @@ > #!/bin/sh > # > # qcow2 pattern test, complex patterns including compression and snapshots > +# Using patterns for 4k cluster size. > # > # > # Copyright (C) 2009 Red Hat, Inc. > @@ -48,13 +49,14 @@ _supported_os Linux > > TEST_OFFSETS="0 4294967296" > TEST_OPS="writev read write readv" > +CLUSTER_SIZE=4096 > > _make_test_img 6G > > echo "Testing empty image:" > for offset in $TEST_OFFSETS; do > echo test2: With offset $offset > - io_test2 $offset > + io_test2 $offset $CLUSTER_SIZE > _check_test_img > done > > @@ -64,7 +66,7 @@ for i in `seq 1 3`; do > for offset in $TEST_OFFSETS; do > echo With snapshot test$i, offset $offset > for op in $TEST_OPS; do > - io_test $op $offset > + io_test $op $offset $CLUSTER_SIZE > done > _check_test_img > done > Index: qemu-iotests/group > =================================================================== > --- qemu-iotests.orig/group 2009-07-06 16:51:59.100239157 +0200 > +++ qemu-iotests/group 2009-07-06 16:52:04.434485231 +0200 > @@ -22,3 +22,5 @@ > 013 rw auto > 014 rw auto > 015 rw snapshot auto > +016 rw auto > +017 rw auto > > ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-09-11 14:04 ` Kevin Wolf @ 2009-09-11 18:40 ` Christoph Hellwig 2009-09-14 8:03 ` Kevin Wolf 0 siblings, 1 reply; 15+ messages in thread From: Christoph Hellwig @ 2009-09-11 18:40 UTC (permalink / raw) To: Kevin Wolf; +Cc: Christoph Hellwig, qemu-devel On Fri, Sep 11, 2009 at 04:04:17PM +0200, Kevin Wolf wrote: > > Done. Below is a version of my original patch with you l2 cluster size > > changes incorporate. The problem is that I really uses up tons of disk > > space for the last test in io_test() for 64k clusters, in fact more than > > I can make available on the laptop I'm travelling with currently.. > > What happened with this patch, Christoph? I just looked at the tests > again and found that we're still aligning our test requests for 4k clusters. I't been a while.. Wasn't this the one that took so long that it didn't complete even in a few hours? ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-09-11 18:40 ` Christoph Hellwig @ 2009-09-14 8:03 ` Kevin Wolf 0 siblings, 0 replies; 15+ messages in thread From: Kevin Wolf @ 2009-09-14 8:03 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel Am 11.09.2009 20:40, schrieb Christoph Hellwig: > On Fri, Sep 11, 2009 at 04:04:17PM +0200, Kevin Wolf wrote: >>> Done. Below is a version of my original patch with you l2 cluster size >>> changes incorporate. The problem is that I really uses up tons of disk >>> space for the last test in io_test() for 64k clusters, in fact more than >>> I can make available on the laptop I'm travelling with currently.. >> >> What happened with this patch, Christoph? I just looked at the tests >> again and found that we're still aligning our test requests for 4k clusters. > > I't been a while.. Wasn't this the one that took so long that it > didn't complete even in a few hours? Hm, might be. However, not testing the critical points is really bad. If we hit any interesting case with the current tests, it's pure luck. What we can do is to reduce the number of write requests. In theory, just one request for each case should be enough. However, if we change the test in this way, we would lose a test doing lots of small writes. Maybe an additional test instead that aligns it requests according to the cluster size? Kevin ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-22 21:05 [Qemu-devel] the qemu-iotests test suite is now available Christoph Hellwig 2009-06-23 9:16 ` Kevin Wolf @ 2009-06-23 16:03 ` Anthony Liguori 2009-06-23 16:36 ` Christoph Hellwig 1 sibling, 1 reply; 15+ messages in thread From: Anthony Liguori @ 2009-06-23 16:03 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel Christoph Hellwig wrote: > I've now uploaded the qemu-iotests suite which exercises the I/O > path using qemu-img, qemu-io and basic qemu use without a guest. > > It's available from my personal kernel.org area at: > > git://git.kernel.org/pub/scm/linux/kernel/git/hch/qemu-iotests.git > > with gitweb at > > http://git.kernel.org/?p=linux/kernel/git/hch/qemu-iotests.git > > To run it simply do a ./check (defaults to raw format) or ./check > -qcow2. > > Thanks to Kevin Wolf for sharing his qcow2 test script which make up > the most interesting scripts in the test suite, and for SGI for beeing > able to re-use the xfsqa test driver. > This is great! The only thing that would be nice to have is the ability to point it at a build directory. Setting PATH isn't enough because it expects a qemu executable whereas my build directory has a qemu-system-x86_64 executable. Why does it need to run qemu? Shouldn't qemu-io/qemu-img be enough? Regards, Anthony Liguori ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-23 16:03 ` Anthony Liguori @ 2009-06-23 16:36 ` Christoph Hellwig 2009-06-24 9:12 ` Kevin Wolf 0 siblings, 1 reply; 15+ messages in thread From: Christoph Hellwig @ 2009-06-23 16:36 UTC (permalink / raw) To: Anthony Liguori; +Cc: Christoph Hellwig, qemu-devel On Tue, Jun 23, 2009 at 11:03:39AM -0500, Anthony Liguori wrote: > > The only thing that would be nice to have is the ability to point it at > a build directory. Setting PATH isn't enough because it expects a qemu > executable whereas my build directory has a qemu-system-x86_64 executable. Now that you remember it I remember the qemu-system-x86_64 problem. I think we can try the various qemu-system-$foo binaries instead. > Why does it need to run qemu? Shouldn't qemu-io/qemu-img be enough? Test 007 uses the savevm command in the qemu monitor. I suspect we could appromiate it whith the snapshot commands in qemu-img, but touching existing testcases is pretty nasty. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] the qemu-iotests test suite is now available 2009-06-23 16:36 ` Christoph Hellwig @ 2009-06-24 9:12 ` Kevin Wolf 0 siblings, 0 replies; 15+ messages in thread From: Kevin Wolf @ 2009-06-24 9:12 UTC (permalink / raw) To: Christoph Hellwig; +Cc: qemu-devel Christoph Hellwig schrieb: > On Tue, Jun 23, 2009 at 11:03:39AM -0500, Anthony Liguori wrote: >> The only thing that would be nice to have is the ability to point it at >> a build directory. Setting PATH isn't enough because it expects a qemu >> executable whereas my build directory has a qemu-system-x86_64 executable. > > Now that you remember it I remember the qemu-system-x86_64 problem. I > think we can try the various qemu-system-$foo binaries instead. And the qemu-system-x86_64 binary is even in a subdirectory whereas qemu-img and qemu-io are in the parent directory. Which would require me to add two directories to PATH. >> Why does it need to run qemu? Shouldn't qemu-io/qemu-img be enough? > > Test 007 uses the savevm command in the qemu monitor. I suspect we > could appromiate it whith the snapshot commands in qemu-img, but > touching existing testcases is pretty nasty. It's not enough. qemu-img snapshot -c doesn't save a VM state which is an important test case. It should be doing unusual things like writing past the end of the virtual hard disk and possibly growing the L1 table when doing so. Kevin ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2009-09-14 8:04 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-06-22 21:05 [Qemu-devel] the qemu-iotests test suite is now available Christoph Hellwig 2009-06-23 9:16 ` Kevin Wolf 2009-06-23 14:31 ` Christoph Hellwig 2009-06-23 14:36 ` Kevin Wolf 2009-06-23 16:41 ` Christoph Hellwig 2009-06-24 7:35 ` Kevin Wolf 2009-07-06 11:18 ` Kevin Wolf 2009-07-06 17:36 ` Christoph Hellwig 2009-07-07 7:30 ` Kevin Wolf 2009-09-11 14:04 ` Kevin Wolf 2009-09-11 18:40 ` Christoph Hellwig 2009-09-14 8:03 ` Kevin Wolf 2009-06-23 16:03 ` Anthony Liguori 2009-06-23 16:36 ` Christoph Hellwig 2009-06-24 9:12 ` Kevin Wolf
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).