From: Stefan Hajnoczi <stefanha@redhat.com>
To: Liu Ping Fan <qemulist@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH v4] QEMUBH: make AioContext's bh re-entrant
Date: Mon, 24 Jun 2013 10:01:02 +0200 [thread overview]
Message-ID: <20130624080102.GC8700@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1372067666-13532-1-git-send-email-pingfank@linux.vnet.ibm.com>
On Mon, Jun 24, 2013 at 05:54:26PM +0800, Liu Ping Fan wrote:
> BH will be used outside big lock, so introduce lock to protect
> between the writers, ie, bh's adders and deleter. The lock only
> affects the writers and bh's callback does not take this extra lock.
> Note that for the same AioContext, aio_bh_poll() can not run in
> parallel yet.
>
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
>
> --------
> v3->v4
> resolve memory order of bh->idle and ->scheduled
> add comments for qemu_bh_delete/cancel
>
>
> ---
> async.c | 32 ++++++++++++++++++++++++++++++--
> include/block/aio.h | 7 +++++++
> 2 files changed, 37 insertions(+), 2 deletions(-)
>
> diff --git a/async.c b/async.c
> index 90fe906..108d7c3 100644
> --- a/async.c
> +++ b/async.c
> @@ -47,11 +47,16 @@ QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque)
> bh->ctx = ctx;
> bh->cb = cb;
> bh->opaque = opaque;
> + qemu_mutex_lock(&ctx->bh_lock);
> bh->next = ctx->first_bh;
> + /* Make sure the members ready before putting bh into list */
> + smp_wmb();
s/members/member is/
prev parent reply other threads:[~2013-06-24 8:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 9:54 [Qemu-devel] [PATCH v4] QEMUBH: make AioContext's bh re-entrant Liu Ping Fan
2013-06-24 8:01 ` Stefan Hajnoczi [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=20130624080102.GC8700@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemulist@gmail.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).