From: Filip Navara <filip.navara@gmail.com>
To: Avi Kivity <avi@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: Clean up after deleting BHs
Date: Tue, 23 Jun 2009 20:08:55 +0200 [thread overview]
Message-ID: <5b31733c0906231108y28995333s83124722195faf16@mail.gmail.com> (raw)
In-Reply-To: <4A41095D.7070608@redhat.com>
On Tue, Jun 23, 2009 at 6:57 PM, Avi Kivity<avi@redhat.com> wrote:
> On 06/23/2009 07:50 PM, Christoph Hellwig wrote:
>>
>> On Tue, Jun 23, 2009 at 04:20:36PM +0300, Avi Kivity wrote:
>>
>>>
>>> Commit 6a7ad299 ("Call qemu_bh_delete at bdrv_aio_bh_cb") deletes
>>> emulated
>>> aio bottom halves to prevent endless accumulation. However, it leaves a
>>> stale ->bh pointer, which is then waited on when the aio is reused.
>>>
>>> Zeroing the pointer fixes the issue, allowing vmdk format images to be
>>> used.
>>>
>>
>> What operations on vmdk images does this cause to fail? qemu-iotests
>> seems to do fine on vmdk so it's nothing yet exercised by it.
>>
>
> Just starting qemu with a vmdk image hangs. I think the very first read
> triggers it.
Actually I think it's the second read ;-)
>
>>> --- a/block.c
>>> +++ b/block.c
>>> @@ -1374,6 +1374,7 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB
>>> *blockacb)
>>> {
>>> BlockDriverAIOCBSync *acb = (BlockDriverAIOCBSync *)blockacb;
>>> qemu_bh_delete(acb->bh);
>>> + acb->bh = NULL;
>>> qemu_aio_release(acb);
>>> }
>>>
>>> @@ -1391,6 +1392,7 @@ static void bdrv_aio_bh_cb(void *opaque)
>>> qemu_vfree(acb->bounce);
>>> acb->common.cb(acb->common.opaque, acb->ret);
>>> qemu_bh_delete(acb->bh);
>>> + acb->bh = NULL;
>>> qemu_aio_release(acb);
>>> }
>>>
>>
>> I think not having the state of the private acb area cleared over a
>> free/realloc cycle is pretty dangerous. Wouldn't it be better to always
>> clear that space in qemu_aio_get?
>>
>
> Maybe, but that's a bigger change. Let's start with this (in stable- too)
> and rework aio later.
>
Agreed, let's get this in, the win32 builds are seriously affected by
the bug due to the absence of AIO on the platform.
Best regards,
Filip Navara
next prev parent reply other threads:[~2009-06-23 18:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-23 13:20 [Qemu-devel] [PATCH] block: Clean up after deleting BHs Avi Kivity
2009-06-23 13:37 ` Filip Navara
2009-06-23 16:50 ` Christoph Hellwig
2009-06-23 16:57 ` Avi Kivity
2009-06-23 18:08 ` Filip Navara [this message]
2009-06-23 18:11 ` Avi Kivity
2009-06-23 18:26 ` Christoph Hellwig
2009-06-23 18:31 ` Avi Kivity
2009-06-23 19:41 ` Christoph Hellwig
2009-06-23 19:50 ` Avi Kivity
2009-06-23 20:21 ` Filip Navara
2009-06-24 18:31 ` Stefan Weil
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=5b31733c0906231108y28995333s83124722195faf16@mail.gmail.com \
--to=filip.navara@gmail.com \
--cc=avi@redhat.com \
--cc=hch@lst.de \
--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).