All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	"open list:Block layer core" <qemu-block@nongnu.org>,
	Max Reitz <mreitz@redhat.com>
Subject: [PULL 06/24] qemu-iotests/199: change discard patterns
Date: Mon, 27 Jul 2020 15:55:25 -0500	[thread overview]
Message-ID: <20200727205543.206624-7-eblake@redhat.com> (raw)
In-Reply-To: <20200727205543.206624-1-eblake@redhat.com>

From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

iotest 199 works too long because of many discard operations. At the
same time, postcopy period is very short, in spite of all these
efforts.

So, let's use less discards (and with more interesting patterns) to
reduce test timing. In the next commit we'll increase postcopy period.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Tested-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200727194236.19551-6-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 44 +++++++++++++++++++++++++-----------------
 1 file changed, 26 insertions(+), 18 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 190e820b8408..da4dae01fb5d 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -30,6 +30,28 @@ size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')


+GiB = 1024 * 1024 * 1024
+
+discards1 = (
+    (0, GiB),
+    (2 * GiB + 512 * 5, 512),
+    (3 * GiB + 512 * 5, 512),
+    (100 * GiB, GiB)
+)
+
+discards2 = (
+    (3 * GiB + 512 * 8, 512),
+    (4 * GiB + 512 * 8, 512),
+    (50 * GiB, GiB),
+    (100 * GiB + GiB // 2, GiB)
+)
+
+
+def apply_discards(vm, discards):
+    for d in discards:
+        vm.hmp_qemu_io('drive0', 'discard {} {}'.format(*d))
+
+
 def event_seconds(event):
     return event['timestamp']['seconds'] + \
         event['timestamp']['microseconds'] / 1000000.0
@@ -80,9 +102,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_b_events = []

     def test_postcopy(self):
-        discard_size = 0x40000000
         granularity = 512
-        chunk = 4096

         result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                name='bitmap', granularity=granularity)
@@ -92,14 +112,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
                                node='drive0', name='bitmap')
         empty_sha256 = result['return']['sha256']

-        s = 0
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
-        s = 0x8000
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+        apply_discards(self.vm_a, discards1 + discards2)

         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
@@ -111,10 +124,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
                                name='bitmap')
         self.assert_qmp(result, 'return', {})
-        s = 0
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+
+        apply_discards(self.vm_a, discards1)

         caps = [{'capability': 'dirty-bitmaps', 'state': True},
                 {'capability': 'events', 'state': True}]
@@ -134,10 +145,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         event_resume = self.vm_b.event_wait('RESUME')
         self.vm_b_events.append(event_resume)

-        s = 0x8000
-        while s < discard_size:
-            self.vm_b.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+        apply_discards(self.vm_b, discards2)

         match = {'data': {'status': 'completed'}}
         event_complete = self.vm_b.event_wait('MIGRATION', match=match)
-- 
2.27.0



  parent reply	other threads:[~2020-07-27 21:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 20:55 [PULL 00/24] bitmaps patches for -rc2, 2020-07-27 Eric Blake
2020-07-27 20:55 ` [PULL 01/24] qcow2: Fix capitalization of header extension constant Eric Blake
2020-07-27 20:55 ` [PULL 02/24] qemu-iotests/199: fix style Eric Blake
2020-07-27 20:55 ` [PULL 03/24] qemu-iotests/199: drop extra constraints Eric Blake
2020-07-27 20:55 ` [PULL 04/24] qemu-iotests/199: better catch postcopy time Eric Blake
2020-07-27 20:55 ` [PULL 05/24] qemu-iotests/199: improve performance: set bitmap by discard Eric Blake
2020-07-27 20:55 ` Eric Blake [this message]
2020-07-27 20:55 ` [PULL 07/24] qemu-iotests/199: increase postcopy period Eric Blake
2020-07-27 20:55 ` [PULL 08/24] migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start Eric Blake
2020-07-27 20:55 ` [PULL 09/24] migration/block-dirty-bitmap: rename state structure types Eric Blake
2020-07-27 20:55 ` [PULL 10/24] migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup Eric Blake
2020-07-27 20:55 ` [PULL 11/24] migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init Eric Blake
2020-07-27 20:55 ` [PULL 12/24] migration/block-dirty-bitmap: refactor state global variables Eric Blake
2020-07-27 20:55 ` [PULL 13/24] migration/block-dirty-bitmap: rename finish_lock to just lock Eric Blake
2020-07-27 20:55 ` [PULL 14/24] migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete Eric Blake
2020-07-27 20:55 ` [PULL 15/24] migration/block-dirty-bitmap: keep bitmap state for all bitmaps Eric Blake
2020-07-27 20:55 ` [PULL 16/24] migration/block-dirty-bitmap: relax error handling in incoming part Eric Blake
2020-07-27 20:55 ` [PULL 17/24] migration/block-dirty-bitmap: cancel migration on shutdown Eric Blake
2020-07-27 20:55 ` [PULL 18/24] migration/savevm: don't worry if bitmap migration postcopy failed Eric Blake
2020-07-27 20:55 ` [PULL 19/24] qemu-iotests/199: prepare for new test-cases addition Eric Blake
2020-07-27 20:55 ` [PULL 20/24] qemu-iotests/199: check persistent bitmaps Eric Blake
2020-07-27 20:55 ` [PULL 21/24] qemu-iotests/199: add early shutdown case to bitmaps postcopy Eric Blake
2020-07-27 20:55 ` [PULL 22/24] qemu-iotests/199: add source-killed " Eric Blake
2020-07-27 20:55 ` [PULL 23/24] iotests: Adjust which migration tests are quick Eric Blake
2020-07-27 20:55 ` [PULL 24/24] migration: Fix typos in bitmap migration comments Eric Blake
2020-07-28 14:24 ` [PULL 00/24] bitmaps patches for -rc2, 2020-07-27 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200727205543.206624-7-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.