qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 7/9] block-migration: remove not needed iothread


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-devel] [PATCH 7/9] block-migration: remove not needed iothread lock
Date: Fri, 16 Jan 2015 16:03:40 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0


Best regards,
Vladimir

On 09.01.2015 01:28, Paolo Bonzini wrote:

On 11/12/2014 15:17, Vladimir Sementsov-Ogievskiy wrote:
-    qemu_mutex_lock_iothread();
+    bdrv_reset_dirty_bitmap(bs, bmds->dirty_bitmap, cur_sector, nr_sectors);
+
      blk->aiocb = bdrv_aio_readv(bs, cur_sector, &blk->qiov,
                                  nr_sectors, blk_mig_read_cb, blk);
- bdrv_reset_dirty_bitmap(bs, bmds->dirty_bitmap, cur_sector, nr_sectors);
-    qemu_mutex_unlock_iothread();
-
bdrv_aio_readv is not thread safe, so it needs the iothread lock.

bdrv_reset_dirty_bitmap is also not thread safe, because
bmds->dirty_bitmap is accessed concurrently by bdrv_reset_dirty
(discard) and bdrv_set_dirty (write).  So it needs the iothread lock too.

Moving bdrv_reset_dirty_bitmap before the read is a good idea.

Paolo
Ok.



reply via email to

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