Skip to content
Snippets Groups Projects
  • Peter Xu's avatar
    cc5ab872
    migration: Unify reset of last_rb on destination node when recover · cc5ab872
    Peter Xu authored
    
    When postcopy recover happens, we need to reset last_rb after each return of
    postcopy_pause_fault_thread() because that means we just got the postcopy
    migration continued.
    
    Unify this reset to the place right before we want to kick the fault thread
    again, when we get the command MIG_CMD_POSTCOPY_RESUME from source.
    
    This is actually more than that - because the main thread on destination will
    now be able to call migrate_send_rp_req_pages_pending() too, so the fault
    thread is not the only user of last_rb now.  Move the reset earlier will allow
    the first call to migrate_send_rp_req_pages_pending() to use the reset value
    even if called from the main thread.
    
    (NOTE: this is not a real fix to 0c26781c mentioned below, however it is just
     a mark that when picking up 0c26781c we'd better have this one too; the real
     fix will come later)
    
    Fixes: 0c26781c ("migration: Sync requested pages after postcopy recovery")
    Tested-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20201102153010.11979-2-peterx@redhat.com>
    Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    cc5ab872
    History
    migration: Unify reset of last_rb on destination node when recover
    Peter Xu authored
    
    When postcopy recover happens, we need to reset last_rb after each return of
    postcopy_pause_fault_thread() because that means we just got the postcopy
    migration continued.
    
    Unify this reset to the place right before we want to kick the fault thread
    again, when we get the command MIG_CMD_POSTCOPY_RESUME from source.
    
    This is actually more than that - because the main thread on destination will
    now be able to call migrate_send_rp_req_pages_pending() too, so the fault
    thread is not the only user of last_rb now.  Move the reset earlier will allow
    the first call to migrate_send_rp_req_pages_pending() to use the reset value
    even if called from the main thread.
    
    (NOTE: this is not a real fix to 0c26781c mentioned below, however it is just
     a mark that when picking up 0c26781c we'd better have this one too; the real
     fix will come later)
    
    Fixes: 0c26781c ("migration: Sync requested pages after postcopy recovery")
    Tested-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20201102153010.11979-2-peterx@redhat.com>
    Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>