Skip to contentSkip to conversation

migration: Fix postcopy bw for recovery

PATCH In review Peter Xu 4 participants 5 messages Sep 6, 2019 – Sep 24, 2019

lore
Share & tools
lore

Peter Xu

author
#0 lore raw

PATCH 1/1 migration: Fix postcopy bw for recovery

We've got max-postcopy-bandwidth parameter but it's not applied correctly after a postcopy recovery so the recovered migration stream will still eat the whole net bandwidth. Fix that up.

---
 migration/migration.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
migration/migration.c +2 -1
index 8b9f2fe30a..b307813aa3 100644
@@ -3327,7 +3327,8 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
 
     if (resume) {
         /* This is a resumed migration */
-        rate_limit = INT64_MAX;
+        rate_limit = s->parameters.max_postcopy_bandwidth /
+            XFER_LIMIT_RATIO;
     } else {
         /* This is a fresh new migration */
         rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Peter Xu

We've got max-postcopy-bandwidth parameter but it's not applied correctly after a postcopy recovery so the recovered migration stream will still eat the whole net bandwidth. Fix that up.

---
 migration/migration.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 5 lines
migration/migration.c +0 -0
index 8b9f2fe30a..b307813aa3 100644

migration/migration.c void migrate_fd_connect(MigrationState *s, Error *error_in) · line 3334

Quoted 9 lines
migration/migration.c +2 -1
@@ -3327,7 +3327,8 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
 
     if (resume) {
         /* This is a resumed migration */
-        rate_limit = INT64_MAX;
+        rate_limit = s->parameters.max_postcopy_bandwidth /
+            XFER_LIMIT_RATIO;
     } else {
         /* This is a fresh new migration */
         rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;

I was confused thinking that the two assignations were the same O:-)

#2 lore raw
In reply to Peter Xu
Quoted 6 lines · * Peter Xu ([email protected]) wrote:

We've got max-postcopy-bandwidth parameter but it's not applied correctly after a postcopy recovery so the recovered migration stream will still eat the whole net bandwidth. Fix that up.

Queued

Quoted 22 lines
---
 migration/migration.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
migration/migration.c +2 -1
index 8b9f2fe30a..b307813aa3 100644
@@ -3327,7 +3327,8 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
 
     if (resume) {
         /* This is a resumed migration */
-        rate_limit = INT64_MAX;
+        rate_limit = s->parameters.max_postcopy_bandwidth /
+            XFER_LIMIT_RATIO;
     } else {
         /* This is a fresh new migration */
         rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;
Signature · 1 line
2.21.0

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#3 lore raw
In reply to Peter Xu

migration-tests hangs intermittently for me, and git bisect led me here. Test script:

i=0; while true; do let i++; echo "= $i ="; MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/migration-test -p /x86_64/migration/postcopy/recovery -k; done

#4 lore raw
Quoted 4 lines · * Markus Armbruster ([email protected]) wrote:

migration-tests hangs intermittently for me, and git bisect led me here. Test script:

i=0; while true; do let i++; echo "= $i ="; MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/migration-test -p /x86_64/migration/postcopy/recovery -k; done

Which is fixed by the patch I posted yesterday:

migration/postcopy: Recognise the recovery states as 'in_postcopy'

Good working finding it using a bisect - it was way too unreliable for me to find repeatably.

The 'Fix postcopy bw for recovery' patch is actually right - it just exposes another existing race.

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK