[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/21] qemu-iotests/199: change discard patterns
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v3 05/21] qemu-iotests/199: change discard patterns |
Date: |
Fri, 24 Jul 2020 11:43:11 +0300 |
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>
---
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 190e820b84..da4dae01fb 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.21.0
- [PATCH v3 for-5.1?? 00/21] Fix error handling during bitmap postcopy, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 04/21] qemu-iotests/199: improve performance: set bitmap by discard, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 01/21] qemu-iotests/199: fix style, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 05/21] qemu-iotests/199: change discard patterns,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v3 02/21] qemu-iotests/199: drop extra constraints, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 06/21] qemu-iotests/199: increase postcopy period, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 03/21] qemu-iotests/199: better catch postcopy time, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 07/21] migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 08/21] migration/block-dirty-bitmap: rename state structure types, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 09/21] migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 10/21] migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init, Vladimir Sementsov-Ogievskiy, 2020/07/24
- [PATCH v3 18/21] qemu-iotests/199: prepare for new test-cases addition, Vladimir Sementsov-Ogievskiy, 2020/07/24