[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/16] block: explicitly acquire aiocontext in t
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH 10/16] block: explicitly acquire aiocontext in timers that need it |
Date: |
Mon, 16 Jan 2017 21:07:02 +0800 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Fri, 01/13 14:17, Paolo Bonzini wrote:
> diff --git a/block/qed.c b/block/qed.c
> index 7f1c508..a21d025 100644
> --- a/block/qed.c
> +++ b/block/qed.c
> @@ -345,10 +345,22 @@ static void qed_need_check_timer_cb(void *opaque)
>
> trace_qed_need_check_timer_cb(s);
>
> + qed_acquire(s);
> qed_plug_allocating_write_reqs(s);
>
> /* Ensure writes are on disk before clearing flag */
> bdrv_aio_flush(s->bs->file->bs, qed_clear_need_check, s);
> + qed_release(s);
> +}
> +
> +void qed_acquire(BDRVQEDState *s)
> +{
> + aio_context_acquire(bdrv_get_aio_context(s->bs));
> +}
> +
> +void qed_release(BDRVQEDState *s)
> +{
> + aio_context_release(bdrv_get_aio_context(s->bs));
> }
>
> static void qed_start_need_check_timer(BDRVQEDState *s)
> diff --git a/block/qed.h b/block/qed.h
> index 9676ab9..ce8c314 100644
> --- a/block/qed.h
> +++ b/block/qed.h
> @@ -198,6 +198,9 @@ enum {
> */
> typedef void QEDFindClusterFunc(void *opaque, int ret, uint64_t offset,
> size_t len);
>
> +void qed_acquire(BDRVQEDState *s);
> +void qed_release(BDRVQEDState *s);
> +
Why cannot these be local (static) functions, in block/qed.c?
> /**
> * Generic callback for chaining async callbacks
> */
Fam
- Re: [Qemu-devel] [PATCH 08/16] qed: introduce qed_aio_start_io and qed_aio_next_io_cb, (continued)
- [Qemu-devel] [PATCH 09/16] aio: push aio_context_acquire/release down to dispatching, Paolo Bonzini, 2017/01/13
- [Qemu-devel] [PATCH 15/16] async: remove unnecessary inc/dec pairs, Paolo Bonzini, 2017/01/13
- [Qemu-devel] [PATCH 13/16] block: explicitly acquire aiocontext in aio callbacks that need it, Paolo Bonzini, 2017/01/13
- [Qemu-devel] [PATCH 16/16] block: document fields protected by AioContext lock, Paolo Bonzini, 2017/01/13
- [Qemu-devel] [PATCH 10/16] block: explicitly acquire aiocontext in timers that need it, Paolo Bonzini, 2017/01/13
- Re: [Qemu-devel] [PATCH 10/16] block: explicitly acquire aiocontext in timers that need it,
Fam Zheng <=
- Re: [Qemu-devel] [PATCH 10/16] block: explicitly acquire aiocontext in timers that need it, Stefan Hajnoczi, 2017/01/18
[Qemu-devel] [PATCH 12/16] block: explicitly acquire aiocontext in bottom halves that need it, Paolo Bonzini, 2017/01/13
[Qemu-devel] [PATCH 11/16] block: explicitly acquire aiocontext in callbacks that need it, Paolo Bonzini, 2017/01/13