qemu-block
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]