[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 11/11] block/snapshot: do not take AioContext lo
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [PATCH 11/11] block/snapshot: do not take AioContext lock |
Date: |
Tue, 11 Jul 2017 11:48:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 |
On 11/07/2017 11:43, Stefan Hajnoczi wrote:
>>>
>>> 1. Must be called under BQL?
>>> 2. Can I/O requests be in flight?
>>> 3. Is it thread-safe?
>>>
>>> Otherwise it will be a nightmare to modify the code since these
>>> constraints are not enforced by the compiler and undocumented.
>> Good point. Are (1) and (3) different ways to say the same thing or do
>> you have other differences in mind?
> There is a difference between (1) and (3). If a function is thread-safe
> then callers can invoke it without any constraints. If a function
> requires a specific lock to be held then that it puts a constraint on
> the caller.
>
> We do have thread-safe functions in the block layer: simple functions
> that fetch a BDS field atomically. There is no need to hold the BQL for
> them.
Ok, so we are in (somewhat violent) agreement. "It's not thread-safe"
pretty much means "must be called under BQL".
I look forward to extending Marc-André's -Wthread-safety experiments to
cover bdrv_drained_begin/end!
Paolo
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH 07/11] block: do not acquire AioContext in check_to_replace_node, (continued)
- [Qemu-block] [PATCH 07/11] block: do not acquire AioContext in check_to_replace_node, Paolo Bonzini, 2017/07/06
- [Qemu-block] [PATCH 09/11] block/replication: do not acquire AioContext, Paolo Bonzini, 2017/07/06
- [Qemu-block] [PATCH 08/11] block: drain I/O around key management, Paolo Bonzini, 2017/07/06
- [Qemu-block] [PATCH 10/11] block: do not take AioContext around reopen, Paolo Bonzini, 2017/07/06
- [Qemu-block] [PATCH 11/11] block/snapshot: do not take AioContext lock, Paolo Bonzini, 2017/07/06
Re: [Qemu-block] [Qemu-devel] [RFC PATCH 00/11] Block layer thread-safety, next part, no-reply, 2017/07/06
Re: [Qemu-block] [RFC PATCH 00/11] Block layer thread-safety, next part, Stefan Hajnoczi, 2017/07/10