qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] fixup! block-migration: acquire AioContext as necessary
Date: Tue, 23 Feb 2016 20:56:35 +0800	[thread overview]
Message-ID: <20160223125635.GC26812@ad.usersys.redhat.com> (raw)
In-Reply-To: <56CC299F.3040509@redhat.com>

On Tue, 02/23 10:42, Paolo Bonzini wrote:
> 
> 
> 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.

Thanks!

Fam

      reply	other threads:[~2016-02-23 12:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 15:10 [Qemu-devel] [PATCH] fixup! block-migration: acquire AioContext as necessary Paolo Bonzini
2016-02-23  5:39 ` Fam Zheng
2016-02-23  9:42   ` Paolo Bonzini
2016-02-23 12:56     ` Fam Zheng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160223125635.GC26812@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).