[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] runstate: ignore finishmigrate -> prelaunch transition
From: |
Laurent Vivier |
Subject: |
Re: [PATCH] runstate: ignore finishmigrate -> prelaunch transition |
Date: |
Thu, 12 Dec 2019 20:40:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 06/12/2019 20:52, Dr. David Alan Gilbert wrote:
> * Laurent Vivier (address@hidden) wrote:
>> Commit 1bd71dce4bf2 tries to prevent a finishmigrate -> prelaunch
>> transition by exiting at the beginning of the main_loop_should_exit()
>> function if the state is already finishmigrate.
>>
>> As the finishmigrate state is set in the migration thread it can
>> happen concurrently to the function. The migration thread and the
>> function are normally protected by the iothread mutex and thus the
>> state should no evolve between the start of the function and its end.
>>
>> Unfortunately during the function life the lock is released by
>> pause_all_vcpus() just before the point we need to be sure we are
>> not in finishmigrate state and if the migration thread is waiting
>> for the lock it will take the opportunity to change the state
>> to finishmigrate.
>
> Ewww.
> I hate those short wakeups for pause_all_vcpus; I'm sure there are loads
> more corners that break.
>
> Still, I _think_ this is an improvement, so:
>
> Reviewed-by: Dr. David Alan Gilbert <address@hidden>
>
Who volunteers to take this in his queue?
Thanks,
Laurent