From: Kevin Wolf <kwolf@redhat.com>
To: Sergio Lopez <slp@redhat.com>
Cc: mreitz@redhat.com, John Snow <jsnow@redhat.com>,
armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-block] [PATCH v2 1/2] blockdev: release the AioContext at drive_backup_prepare
Date: Thu, 10 Oct 2019 17:02:32 +0200 [thread overview]
Message-ID: <20191010150232.GD7616@localhost.localdomain> (raw)
In-Reply-To: <87o8yyi35x.fsf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2142 bytes --]
Am 03.10.2019 um 11:33 hat Sergio Lopez geschrieben:
>
> Sergio Lopez <slp@redhat.com> writes:
>
> > Kevin Wolf <kwolf@redhat.com> writes:
> >
> >> Am 13.09.2019 um 21:54 hat John Snow geschrieben:
> >>>
> >>>
> >>> On 9/13/19 11:25 AM, Sergio Lopez wrote:
> >>> > do_drive_backup() already acquires the AioContext, so release it
> >>> > before the call.
> >>> >
> >>> > Signed-off-by: Sergio Lopez <slp@redhat.com>
> >>> > ---
> >>> > blockdev.c | 6 +-----
> >>> > 1 file changed, 1 insertion(+), 5 deletions(-)
> >>> >
> >>> > diff --git a/blockdev.c b/blockdev.c
> >>> > index fbef6845c8..3927fdab80 100644
> >>> > --- a/blockdev.c
> >>> > +++ b/blockdev.c
> >>> > @@ -1783,20 +1783,16 @@ static void drive_backup_prepare(BlkActionState *common, Error **errp)
> >>> >
> >>> > aio_context = bdrv_get_aio_context(bs);
> >>> > aio_context_acquire(aio_context);
> >>> > -
> >>
> >> Are you removing this unrelated empty line intentionally?
> >
> > Yes. In the sense of that whole set of lines being a "open drained
> > section" block.
> >
> >>> > /* Paired with .clean() */
> >>> > bdrv_drained_begin(bs);
> >>>
> >>> Do we need to make this change to blockdev_backup_prepare as well?
> >>
> >> Actually, the whole structure feels a bit wrong. We get the bs here and
> >> take its lock, then release the lock again and forget the reference,
> >> only to do both things again inside do_drive_backup().
> >>
> >> The way snapshots work is that the "normal" snapshot commands are
> >> wrappers that turn it into a single-entry transaction. Then you have
> >> only one code path where you can resolve the ID and take the lock just
> >> once. So maybe backup should work like this, too?
> >
> > I'm neither opposed nor in favor, but I think this is outside the scope
> > of this patch series.
>
> Kevin, do you think we should attempt to just fix this issue (which
> would make a possible backport easier) or try to move all blockdev
> actions to be transaction-based?
Maybe fix it and then do the cleanup on top, though possibly in the same
series?
Kevin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2019-10-10 15:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 15:25 [Qemu-devel] [PATCH v2 0/2] blockdev: avoid acquiring AioContext lock twice at do_drive_backup() Sergio Lopez
2019-09-13 15:25 ` [Qemu-devel] [PATCH v2 1/2] blockdev: release the AioContext at drive_backup_prepare Sergio Lopez
2019-09-13 19:54 ` [Qemu-devel] [Qemu-block] " John Snow
2019-09-16 7:53 ` Kevin Wolf
2019-09-16 11:17 ` Sergio Lopez
2019-10-03 9:33 ` Sergio Lopez
2019-10-10 15:02 ` Kevin Wolf [this message]
2019-09-16 11:17 ` [Qemu-devel] " Sergio Lopez
2019-09-13 15:25 ` [Qemu-devel] [PATCH v2 2/2] blockdev: honor bdrv_try_set_aio_context() context requirements Sergio Lopez
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=20191010150232.GD7616@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=jsnow@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=slp@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).