[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] migration: Fix multi-thread compression bug
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH] migration: Fix multi-thread compression bug |
Date: |
Wed, 04 May 2016 11:03:21 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
"Dr. David Alan Gilbert" <address@hidden> wrote:
> * Liang Li (address@hidden) 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 <address@hidden>
>
> 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.