[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 04/28] tests/perf: Test lseek influence on qcow2 bloc
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 04/28] tests/perf: Test lseek influence on qcow2 block-status |
Date: |
Mon, 3 Jun 2019 17:02:09 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Block layer may recursively check block_status in file child of qcow2,
if qcow2 driver returned DATA. There are several test cases to check
influence of lseek on block_status performance. To see real difference
run on tmpfs.
Tests originally created by Kevin, I just refactored and put them
together into one executable file with simple output.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/perf/block/qcow2/convert-blockstatus | 71 ++++++++++++++++++++++
1 file changed, 71 insertions(+)
create mode 100755 tests/perf/block/qcow2/convert-blockstatus
diff --git a/tests/perf/block/qcow2/convert-blockstatus
b/tests/perf/block/qcow2/convert-blockstatus
new file mode 100755
index 0000000000..a1a3c1ef43
--- /dev/null
+++ b/tests/perf/block/qcow2/convert-blockstatus
@@ -0,0 +1,71 @@
+#!/bin/bash
+#
+# Test lseek influence on qcow2 block-status
+#
+# Block layer may recursively check block_status in file child of qcow2, if
+# qcow2 driver returned DATA. There are several test cases to check influence
+# of lseek on block_status performance. To see real difference run on tmpfs.
+#
+# Copyright (c) 2019 Virtuozzo International GmbH. All rights reserved.
+#
+# Tests originally written by Kevin Wolf
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+if [ "$#" -lt 1 ]; then
+ echo "Usage: $0 SOURCE_FILE"
+ exit 1
+fi
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../../.." >/dev/null 2>&1
&& pwd )"
+QEMU_IMG="$ROOT_DIR/qemu-img"
+QEMU_IO="$ROOT_DIR/qemu-io"
+
+size=1G
+src="$1"
+
+# test-case plain
+
+(
+$QEMU_IMG create -f qcow2 "$src" $size
+for i in $(seq 16384 -1 0); do
+ echo "write $((i * 65536)) 64k"
+done | $QEMU_IO "$src"
+) > /dev/null
+
+echo -n "plain: "
+/usr/bin/time -f %e $QEMU_IMG convert -n "$src" null-co://
+
+# test-case forward
+
+(
+$QEMU_IMG create -f qcow2 "$src" $size
+for i in $(seq 0 2 16384); do
+ echo "write $((i * 65536)) 64k"
+done | $QEMU_IO "$src"
+for i in $(seq 1 2 16384); do
+ echo "write $((i * 65536)) 64k"
+done | $QEMU_IO "$src"
+) > /dev/null
+
+echo -n "forward: "
+/usr/bin/time -f %e $QEMU_IMG convert -n "$src" null-co://
+
+# test-case prealloc
+
+$QEMU_IMG create -f qcow2 -o preallocation=metadata "$src" $size > /dev/null
+
+echo -n "prealloc: "
+/usr/bin/time -f %e $QEMU_IMG convert -n "$src" null-co://
--
2.20.1
- [Qemu-block] [PULL 00/28] Block layer patches, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 01/28] block: Drain source node in bdrv_replace_node(), Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 03/28] blockdev: fix missed target unref for drive-backup, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 04/28] tests/perf: Test lseek influence on qcow2 block-status,
Kevin Wolf <=
- [Qemu-block] [PULL 02/28] iotests: Test commit job start with concurrent I/O, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 05/28] block: avoid recursive block_status call if possible, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 06/28] block/io: Delay decrementing the quiesce_counter, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 08/28] block/linux-aio: Drop unused BlockAIOCB submission method, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 09/28] nvme: add Get/Set Feature Timestamp support, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 07/28] iotests: Test cancelling a job and closing the VM, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 10/28] test-block-iothread: Check filter node in test_propagate_mirror, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 12/28] block: Add Error to blk_set_aio_context(), Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 11/28] nbd-server: Call blk_set_allow_aio_context_change(), Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 13/28] block: Add BlockBackend.ctx, Kevin Wolf, 2019/06/03