[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: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 10/16] block: explicitly acquire aiocontext in timers that need it |
Date: |
Mon, 16 Jan 2017 14:32:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 16/01/2017 14:07, Fam Zheng wrote:
> 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?
Patch 13 uses them elsewhere. Should I put them in a separate patch?
Paolo
>> /**
>> * Generic callback for chaining async callbacks
>> */
>
> Fam
>
>
- [Qemu-devel] [PATCH 09/16] aio: push aio_context_acquire/release down to dispatching, (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, 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