From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MNmEF-0002zJ-3P for qemu-devel@nongnu.org; Mon, 06 Jul 2009 07:19:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MNmEA-0002vO-Fq for qemu-devel@nongnu.org; Mon, 06 Jul 2009 07:19:22 -0400 Received: from [199.232.76.173] (port=54135 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MNmEA-0002vG-9C for qemu-devel@nongnu.org; Mon, 06 Jul 2009 07:19:18 -0400 Received: from mx2.redhat.com ([66.187.237.31]:32998) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MNmE9-0000g0-QA for qemu-devel@nongnu.org; Mon, 06 Jul 2009 07:19:18 -0400 Message-ID: <4A51DD6C.8030907@redhat.com> Date: Mon, 06 Jul 2009 13:18:04 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] the qemu-iotests test suite is now available References: <20090622210523.GA8024@lst.de> <4A409D65.3040104@redhat.com> <20090623143105.GA17748@lst.de> <4A40E86D.9060907@redhat.com> <20090623164130.GB27211@lst.de> In-Reply-To: <20090623164130.GB27211@lst.de> Content-Type: multipart/mixed; boundary="------------020509000804090904090509" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------020509000804090904090509 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --------------020509000804090904090509 Content-Type: text/plain; name="0001-qemu-iotests-Allow-varying-cluster-sizes-in-io_test.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-qemu-iotests-Allow-varying-cluster-sizes-in-io_test.pat"; filename*1="ch" >>From ddacd8285b140427ced9b61c5a74e47ed1d067b6 Mon Sep 17 00:00:00 2001 From: Kevin Wolf 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 --- 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 --------------020509000804090904090509--