migration: Postpone the kick of the fault thread after recover
authorPeter Xu <peterx@redhat.com>
Mon, 2 Nov 2020 15:30:10 +0000 (10:30 -0500)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 2 Nov 2020 18:25:48 +0000 (18:25 +0000)
commit5e773431134a6c3f65c0088d578384577c4a3f2c
tree3dcaff6ee42513800cef5d1a638a12af6d78f8ed
parentcc5ab87200257199eba91aba9baf141ae0e91d0c
migration: Postpone the kick of the fault thread after recover

The new migrate_send_rp_req_pages_pending() call should greatly improve
destination responsiveness because it will resync faulted address after
postcopy recovery.  However it is also the 1st place to initiate the page
request from the main thread.

One thing is overlooked on that migrate_send_rp_message_req_pages() is not
designed to be thread-safe.  So if we wake the fault thread before syncing all
the faulted pages in the main thread, it means they can race.

Postpone the wake up operation after the sync of faulted addresses.

Fixes: 0c26781c09 ("migration: Sync requested pages after postcopy recovery")
Tested-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20201102153010.11979-3-peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/savevm.c