qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 21/30] migration: move exit condition to migrati


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH 21/30] migration: move exit condition to migration thread
Date: Fri, 26 Oct 2012 13:43:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Paolo Bonzini <address@hidden> wrote:
> Il 18/10/2012 09:30, Juan Quintela ha scritto:
>> -        if (s->migration_state->complete) {
>> +        qemu_mutex_lock_iothread();
>
> So, was it a bug that we were accessing ->complete without the BQL?
>
>> +        if (m->state != MIG_STATE_ACTIVE) {
>> +            DPRINTF("put_ready returning because of non-active state\n");
>
> The contents of the debug message obsolete.  Besides, I would just put
> the two branches in the same "if (m->state != MIG_STATE_ACTIVE ||
> m->complete)".

BQL is not needed.  Complete is only used by the migration thread.  but
maintaing it outside of the iothread lock, makes locking even more complicated.

>
>> +            qemu_mutex_unlock_iothread();
>>              break;
>>          }
>> +        if (m->complete) {
>> +            qemu_mutex_unlock_iothread();
>> +            break;
>> +        }
>> +        qemu_mutex_unlock_iothread();
>> +
>
> Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]