Skip to contentSkip to conversation

not use multifd during postcopy

PATCH In review Wei Yang 2 participants 11 messages Oct 25, 2019 – Jan 10, 2020

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

cover not use multifd during postcopy

We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure.

Patch 1 does proper cleanup, otherwise we may have data corruption. Patch 2 does the main job.

BTW, current multifd synchronization method needs a cleanup. Will send another patch set.

Wei Yang (2):
migration/multifd: clean pages after filling packet migration/multifd: not use multifd during postcopy

 migration/ram.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/2 migration/multifd: clean pages after filling packet

This is a preparation for the next patch:

not use multifd during postcopy.

Without enabling postcopy, everything looks good. While after enabling postcopy, migration may fail even not use multifd during postcopy. The reason is the pages is not properly cleared and *old* target page will continue to be transferred.

After clean pages, migration succeeds.

---
 migration/ram.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
migration/ram.c +4 -2
index 80dd2d55f9..7087bb73ed 100644
@@ -929,10 +929,10 @@ static int multifd_send_pages(RAMState *rs)
         }
         qemu_mutex_unlock(&p->mutex);
     }
-    p->pages->used = 0;
+    assert(!p->pages->used);
+    assert(!p->pages->block);
 
     p->packet_num = multifd_send_state->packet_num++;
-    p->pages->block = NULL;
     multifd_send_state->pages = p->pages;
     p->pages = pages;
     transferred = ((uint64_t) pages->used) * TARGET_PAGE_SIZE + p->packet_len;
@@ -1114,6 +1114,8 @@ static void *multifd_send_thread(void *opaque)
             p->flags = 0;
             p->num_packets++;
             p->num_pages += used;
+            p->pages->used = 0;
+            p->pages->block = NULL;
             qemu_mutex_unlock(&p->mutex);
 
             trace_multifd_send(p->id, packet_num, used, flags,
Signature · 1 line
2.17.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] migration/multifd: clean pages after filling packet

Quoted 4 lines · Wei Yang

This is a preparation for the next patch:

not use multifd during postcopy.

Quoted 8 lines

Without enabling postcopy, everything looks good. While after enabling postcopy, migration may fail even not use multifd during postcopy. The reason is the pages is not properly cleared and *old* target page will continue to be transferred.

After clean pages, migration succeeds.

I don't like asserts, but I understand why you put them there.

author
#3 lore raw

PATCH 2/2 migration/multifd: not use multifd during postcopy

In reply to Wei Yang

We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure.

Skip multifd during postcopy.

---
 migration/ram.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
migration/ram.c +6 -3
index 7087bb73ed..5876054195 100644
@@ -2547,10 +2547,13 @@ static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss,
     }
 
     /*
-     * do not use multifd for compression as the first page in the new
-     * block should be posted out before sending the compressed page
+     * Do not use multifd for:
+     * 1. Compression as the first page in the new block should be posted out
+     *    before sending the compressed page
+     * 2. In postcopy as one whole host page should be placed
      */
-    if (!save_page_use_compression(rs) && migrate_use_multifd()) {
+    if (!save_page_use_compression(rs) && migrate_use_multifd()
+        && !migration_in_postcopy()) {
         return ram_save_multifd_page(rs, block, offset);
     }
 
Signature · 1 line
2.17.1
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] migration/multifd: not use multifd during postcopy

Quoted 6 lines · Wei Yang

We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure.

Skip multifd during postcopy.

I was working in a different implementation, but I agree with the idea.

My patch series try to decide during negotiation if multifd + everything else is setup or not.

Thanks, Juan.

author
#5 lore raw

Re: [PATCH 2/2] migration/multifd: not use multifd during postcopy

Quoted 6 lines · Juan Quintela
Quoted 5 lines · Wei Yang

We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure.

Skip multifd during postcopy.

Quoted 9 lines
Quoted 1 line

I was working in a different implementation, but I agree with the idea.

My patch series try to decide during negotiation if multifd + everything else is setup or not.

Look forward your approach :-)

Quoted 1 line

Thanks, Juan.

Signature · 2 lines
Wei Yang
Help you, Help me
author
#6 lore raw
In reply to Wei Yang

Ping for comments.

Quoted 18 lines · Wei Yang

We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure.

Patch 1 does proper cleanup, otherwise we may have data corruption. Patch 2 does the main job.

BTW, current multifd synchronization method needs a cleanup. Will send another patch set.

Wei Yang (2):
migration/multifd: clean pages after filling packet migration/multifd: not use multifd during postcopy

migration/ram.c | 15 ++++++++++-----

1 file changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
Signature · 2 lines
Wei Yang
Help you, Help me
author
#7 lore raw
In reply to Wei Yang

Would this one be picked up this time?

Quoted 18 lines · Wei Yang

We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure.

Patch 1 does proper cleanup, otherwise we may have data corruption. Patch 2 does the main job.

BTW, current multifd synchronization method needs a cleanup. Will send another patch set.

Wei Yang (2):
migration/multifd: clean pages after filling packet migration/multifd: not use multifd during postcopy

migration/ram.c | 15 ++++++++++-----

1 file changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
Signature · 2 lines
Wei Yang
Help you, Help me
author
#8 lore raw
Quoted 1 line · Wei Yang

Would this one be picked up this time?

Happy new year to all.

Can I ask the plan for this patch set?

Quoted 24 lines · Wei Yang
Quoted 18 lines

We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure.

Patch 1 does proper cleanup, otherwise we may have data corruption. Patch 2 does the main job.

BTW, current multifd synchronization method needs a cleanup. Will send another patch set.

Wei Yang (2):
migration/multifd: clean pages after filling packet migration/multifd: not use multifd during postcopy

migration/ram.c | 15 ++++++++++-----

1 file changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
Signature · 2 lines
Wei Yang
Help you, Help me
Signature · 2 lines
Wei Yang
Help you, Help me
#9 lore raw
Quoted 6 lines · Wei Yang
Quoted 1 line · Wei Yang

Would this one be picked up this time?

Happy new year to all.

Can I ask the plan for this patch set?

queued

Quoted 25 lines
Quoted 25 lines · Wei Yang
Quoted 18 lines

We don't support multifd during postcopy, but user still could enable both multifd and postcopy. This leads to migration failure.

Patch 1 does proper cleanup, otherwise we may have data corruption. Patch 2 does the main job.

BTW, current multifd synchronization method needs a cleanup. Will send another patch set.

Wei Yang (2):
migration/multifd: clean pages after filling packet migration/multifd: not use multifd during postcopy

migration/ram.c | 15 ++++++++++-----

1 file changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
Signature · 2 lines
Wei Yang
Help you, Help me
author
#10 lore raw
Quoted 10 lines · Juan Quintela
Quoted 6 lines · Wei Yang
Quoted 1 line · Wei Yang

Would this one be picked up this time?

Happy new year to all.

Can I ask the plan for this patch set?

queued

Thanks :-)

Signature · 2 lines
Wei Yang
Help you, Help me