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: Stefan Hajnoczi
Subject: Re: [Qemu-block] [PATCH 11/11] block/snapshot: do not take AioContext lock
Date: Wed, 12 Jul 2017 11:42:02 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

On Tue, Jul 11, 2017 at 11:48:02AM +0200, Paolo Bonzini wrote:
> 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!

Sounds good :).

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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