From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org, famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] async: add aio_bh_schedule_oneshot
Date: Wed, 5 Oct 2016 16:20:10 +0200 [thread overview]
Message-ID: <20161005142010.GE1657@noname.str.redhat.com> (raw)
In-Reply-To: <ac0f7b1b-58a8-9633-39e4-b8832a59f90f@redhat.com>
Am 05.10.2016 um 15:55 hat Paolo Bonzini geschrieben:
> On 05/10/2016 15:13, Stefan Hajnoczi wrote:
> > > qemu_bh_delete is already clearing bh->scheduled at the same time
> > > as it's setting bh->deleted. Since it's not using any memory
> > > barriers, there is no synchronization going on for bh->deleted,
> > > and this makes the bh->deleted checks superfluous in aio_compute_timeout,
> > > aio_bh_poll and aio_ctx_check.
> >
> > Yikes. On one hand this sounds scary but in practice qemu_bh_delete()
> > isn't called from another thread so the next aio_bh_poll() will indeed
> > clean it up instead of dispatching a deleted BH.
> >
> > Due to the nature of this change I suggest making it in a separate
> > patch.
>
> Separate from what? (Sorry if I'm being dense).
>
> >>
> >> + * aio_bh_schedule_oneshot: Allocate a new bottom half structure that will run
> >> + * only once and as soon as possible.
> >> + *
> >> + * Bottom halves are lightweight callbacks whose invocation is guaranteed
> >> + * to be wait-free, thread-safe and signal-safe. The #QEMUBH structure
> >> + * is opaque and must be allocated prior to its use.
> >
> > I'm confused. There is no QEMUBH structure in this function
> > prototype. Is this comment from an earlier version of this function?
>
> No, it's from aio_bh_new. Of course this one is neither wait-free nor
> signal-safe. Kevin, do you want me to respin?
If the comment is wrong, either post a v2 of this patch or just reply
with a new version of the comment and I'll squash it in. Your choice, I
don't mind either way.
Kevin
next prev parent reply other threads:[~2016-10-05 14:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-03 16:14 [Qemu-devel] [PATCH 0/2] block: introduce and use aio_bh_schedule_oneshot Paolo Bonzini
2016-10-03 16:14 ` [Qemu-devel] [PATCH 1/2] async: add aio_bh_schedule_oneshot Paolo Bonzini
2016-10-05 13:13 ` Stefan Hajnoczi
2016-10-05 13:55 ` Paolo Bonzini
2016-10-05 14:20 ` Kevin Wolf [this message]
2016-10-05 14:25 ` Paolo Bonzini
2016-10-05 15:26 ` Kevin Wolf
2016-10-03 16:14 ` [Qemu-devel] [PATCH 2/2] block: use aio_bh_schedule_oneshot Paolo Bonzini
2016-10-05 13:16 ` Stefan Hajnoczi
2016-10-05 11:08 ` [Qemu-devel] [PATCH 0/2] block: introduce and " Kevin Wolf
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=20161005142010.GE1657@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=famz@redhat.com \
--cc=pbonzini@redhat.com \
--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).