From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Fam Zheng <famz@redhat.com>,
"Jason J. Herne" <jjherne@linux.vnet.ibm.com>,
qemu block <qemu-block@nongnu.org>,
Juan Quintela <quintela@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-block] coroutines: block: Co-routine re-entered recursively when migrating disk with iothreads
Date: Thu, 9 Jun 2016 09:48:18 +0100 [thread overview]
Message-ID: <CAJSP0QV5Ot-TghtvGH5mm4nZRDBs5D5+7fwu2dJSk8zidpcdag@mail.gmail.com> (raw)
In-Reply-To: <CAJSP0QWfgZ2k8f+GUKCnwrC0Uw74-YjG=oNk-+kh1tzyuoXUjg@mail.gmail.com>
On Thu, Jun 9, 2016 at 9:47 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Thu, Jun 9, 2016 at 9:25 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> On 09/06/2016 09:35, Stefan Hajnoczi wrote:
>>>
>>> if (s->dataplane) {
>>> virtio_blk_data_plane_stop(s->dataplane);
>>> }
>>>
>>> virtio_save(vdev, f);
>>> }
>>>
>>> We reach the situation I described where BDS AioContext changes but
>>> mirror_run() is still in the IOThread AioContext.
>>
>> Why is the virtio_blk_data_plane_stop necessary? It used to sync
>> between vring and virtio state, but that's not required anymore---and we
>> know that the virtqueues are quiescent at this point...
>
> I agree. It doesn't seem necessary anymore unless I'm missing a race
> condition with ioeventfd.
>
> It was introduced so that the savevm command (without live migration!) works:
>
> commit 10a06fd65f667a972848ebbbcac11bdba931b544
> Author: Pavel Butsykin <pbutsykin@virtuozzo.com>
> Date: Mon Oct 26 14:42:57 2015 +0300
>
> virtio: sync the dataplane vring state to the virtqueue before virtio_save
>
> We can remove it now.
BTW this doesn't mean that the blockjobs AioContext following problem
is solved. AioContexts can still change if the guest resets the
virtio device, for example.
I suspect we'll still hit undefined behavior when that happens.
Stefan
next prev parent reply other threads:[~2016-06-09 8:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-23 18:54 [Qemu-devel] coroutines: block: Co-routine re-entered recursively when migrating disk with iothreads Jason J. Herne
2016-05-24 2:12 ` Fam Zheng
2016-05-24 15:05 ` Jason J. Herne
2016-05-25 8:36 ` Fam Zheng
2016-06-06 18:55 ` Jason J. Herne
2016-06-07 2:44 ` Fam Zheng
2016-06-07 12:42 ` Jason J. Herne
2016-06-08 15:30 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-08 16:03 ` Paolo Bonzini
2016-06-09 7:35 ` Stefan Hajnoczi
2016-06-09 8:25 ` Paolo Bonzini
2016-06-09 8:47 ` Stefan Hajnoczi
2016-06-09 8:48 ` Stefan Hajnoczi [this message]
2016-06-09 10:02 ` Paolo Bonzini
2016-06-09 16:31 ` [Qemu-devel] " Stefan Hajnoczi
2016-06-09 18:19 ` Jason J. Herne
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=CAJSP0QV5Ot-TghtvGH5mm4nZRDBs5D5+7fwu2dJSk8zidpcdag@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=famz@redhat.com \
--cc=jjherne@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
/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).