[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant |
Date: |
Mon, 17 Jun 2013 17:28:14 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Jun 16, 2013 at 07:21:21PM +0800, Liu Ping Fan wrote:
> @@ -47,8 +47,12 @@ 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 memebers ready before putting bh into list */
s/memebers/members/
> + smp_wmb();
Why lock bh_lock before assigning bh->next? Could you lock the mutex
here and then drop the smp_wmb() since the pthread function already does
that?
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_11
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), (continued)
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Paolo Bonzini, 2013/06/20
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Peter Sewell, 2013/06/18
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Torvald Riegel, 2013/06/18
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Paul E. McKenney, 2013/06/18
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Torvald Riegel, 2013/06/19
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Torvald Riegel, 2013/06/18
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Andrew Haley, 2013/06/18
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Paolo Bonzini, 2013/06/19
- Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations), Andrew Haley, 2013/06/19
[Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant, Liu Ping Fan, 2013/06/16
- Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant,
Stefan Hajnoczi <=
Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant, mdroth, 2013/06/18
- Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant, mdroth, 2013/06/18
- Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant, Paolo Bonzini, 2013/06/18
- Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant, mdroth, 2013/06/18
- Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant, Paolo Bonzini, 2013/06/19
- Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant, Stefan Hajnoczi, 2013/06/20
Re: [Qemu-devel] [PATCH v2 0/2] make AioContext's bh re-entrant, Paolo Bonzini, 2013/06/17