qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] the qemu-iotests test suite is now available


From: Kevin Wolf
Subject: Re: [Qemu-devel] the qemu-iotests test suite is now available
Date: Mon, 06 Jul 2009 13:18:04 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

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
>From ddacd8285b140427ced9b61c5a74e47ed1d067b6 Mon Sep 17 00:00:00 2001
From: Kevin Wolf <address@hidden>
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 <address@hidden>
---
 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]