qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [PATCH v2 0/3] block: Start/end drain on correct AioContext
Date: Thu, 10 Nov 2022 18:46:23 +0100	[thread overview]
Message-ID: <Y2047+8HinvJE25K@redhat.com> (raw)
In-Reply-To: <4b94c12a-13d3-67a0-f46b-631c40e2b2cb@redhat.com>

Am 10.11.2022 um 17:11 hat Hanna Reitz geschrieben:
> On 10.11.22 15:01, Kevin Wolf wrote:
> > Am 07.11.2022 um 16:13 hat Hanna Reitz geschrieben:
> > > Hi,
> > > 
> > > v1 cover letter:
> > > https://lists.nongnu.org/archive/html/qemu-block/2022-09/msg00389.html
> > > 
> > > bdrv_replace_child_noperm() drains the child via
> > > bdrv_parent_drained_{begin,end}_single().  When it removes a child, the
> > > bdrv_parent_drained_end_single() at its end will be called on an empty
> > > child, making the BDRV_POLL_WHILE() in it poll the main AioContext
> > > (because c->bs is NULL).
> > > 
> > > That’s wrong, though, because it’s supposed to operate on the parent.
> > > bdrv_parent_drained_end_single_no_poll() will have scheduled any BHs in
> > > the parents’ AioContext, which may be anything, not necessarily the main
> > > context.  Therefore, we must poll the parent’s context.
> > > 
> > > Patch 3 does this for both bdrv_parent_drained_{begin,end}_single().
> > > Patch 1 ensures that we can legally call
> > > bdrv_child_get_parent_aio_context() from those I/O context functions,
> > > and patch 2 fixes blk_do_set_aio_context() to not cause an assertion
> > > failure if it beginning a drain can end up in blk_get_aio_context()
> > > before blk->ctx has been updated.
> > Thanks, applied to the block branch.
> 
> Thanks!
> 
> I tested your drain series, and it does indeed fix the bug, too.
> (Sorry for the delay, I thought it’d take less time to write an
> iotest...)

Thanks for testing, it's good to have this confirmed.

> > I would still be interested in a test case as a follow-up.
> 
> Got it working now and sent as “tests/stream-under-throttle: New test”.

Great! I'll take a look.

Kevin



      reply	other threads:[~2022-11-10 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 15:13 [PATCH v2 0/3] block: Start/end drain on correct AioContext Hanna Reitz
2022-11-07 15:13 ` [PATCH v2 1/3] block: Make bdrv_child_get_parent_aio_context I/O Hanna Reitz
2022-11-07 15:13 ` [PATCH v2 2/3] block-backend: Update ctx immediately after root Hanna Reitz
2022-11-07 15:13 ` [PATCH v2 3/3] block: Start/end drain on correct AioContext Hanna Reitz
2022-11-08 14:13 ` [PATCH v2 0/3] " Kevin Wolf
2022-11-08 14:23   ` Kevin Wolf
2022-11-10 14:01 ` Kevin Wolf
2022-11-10 16:11   ` Hanna Reitz
2022-11-10 17:46     ` Kevin Wolf [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=Y2047+8HinvJE25K@redhat.com \
    --to=kwolf@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --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).