"Dr. David Alan Gilbert" <dgilb...@redhat.com> wrote: > * Liang Li (liang.z...@intel.com) wrote: >> Recently, a bug related to multiple thread compression feature for >> live migration is reported. The destination side will be blocked >> during live migration if there are heavy workload in host and >> memory intensive workload in guest, this is most likely to happen >> when there is one decompression thread. >> >> Some parts of the decompression code are incorrect: >> 1. The main thread receives data from source side will enter a busy >> loop to wait for a free decompression thread. >> 2. A lock is needed to protect the decomp_param[idx]->start, because >> it is checked in the main thread and is updated in the decompression >> thread. >> >> Fix these two issues by following the code pattern for compression. >> > > OK, I think that's an improvement - but I have a question. > Since it's an improvement (and basically now the same as compress): > > Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > > however, my question is: > What guarantee's that all of the decompression has finished by the time > the VM is started? I see in migration/migration.c that we have: > > if (!global_state_received() || > global_state_get_runstate() == RUN_STATE_RUNNING) { > if (autostart) { > vm_start(); > } else { > runstate_set(RUN_STATE_PAUSED); > } > } else { > runstate_set(global_state_get_runstate()); > } > migrate_decompress_threads_join();
You are right here. If we don't want to do the join earlier, we need to do the equivalent of looking that all threads have set param->done as true. That is what I do on the multiple-fd code. Later, Juan.