[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] fixup! block-migration: acquire AioContext as n
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] fixup! block-migration: acquire AioContext as necessary |
Date: |
Tue, 23 Feb 2016 10:42:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 23/02/2016 06:39, Fam Zheng wrote:
> BTW, could you also explain the blk_mig_lock() question (*) I had?
>
> *: https://lists.gnu.org/archive/html/qemu-devel/2016-02/msg03317.html
Sorry, missed that:
>
>> @@ -597,21 +627,28 @@ static void block_migration_cleanup(void *opaque)
>> {
>> BlkMigDevState *bmds;
>> BlkMigBlock *blk;
>> + AioContext *ctx;
>>
>> bdrv_drain_all();
>>
>> unset_dirty_tracking();
>>
>> - blk_mig_lock();
>
> Why is it okay to skip the blk_mig_lock() for block_mig_state.bmds_list?
The bmds_list is not protected by blk_mig_lock:
/* Written during setup phase. Can be read without a lock. */
int blk_enable;
int shared_base;
QSIMPLEQ_HEAD(bmds_list, BlkMigDevState) bmds_list;
int64_t total_sector_sum;
bool zero_blocks;
block_migration_cleanup is called from qemu_savevm_state_cleanup, when
there can be no concurrency between the migration thread and the I/O
thread. In fact the call of qemu_savevm_state_cleanup might as well be
moved out of the migration thread.
Paolo