[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC for-2.7] block: keep AioContext pointer in BlockBa

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC for-2.7] block: keep AioContext pointer in BlockBackend
Date: Mon, 9 May 2016 18:48:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1

On 11/04/2016 16:14, Stefan Hajnoczi wrote:
> 1. BlockBackend falls back to the QEMU main loop AioContext when there
>    is no root BlockDriverState.  This means the drive loses its
>    AioContext during media change and would break dataplane.
> 2. BlockBackend state used from multiple threads has no lock.  Race
>    conditions will creep in as functionality is moved from
>    BlockDriverState to BlockBackend due to the absense of a lock.  The
>    monitor cannot access BlockBackend state safely while an IOThread is
>    also accessing the state.
> Both issue #1 and #2 are mostly theoretical at the moment.  I haven't
> figured out a way to trigger #1 with virtio-blk (does not support media
> change) or virtio-scsi (blocks the eject operation).  #2 may be possible
> with block accounting statistics in BlockBackend but I'm not aware of a
> crash that can be triggered.

I'm not sure I agree with #2, as we should move away for the
super-coarse AioContext lock (it is heavyweight and it doesn't play well
with multiqueue).  Atomics can be used for statistics, while the
time-based accounting probably should be made optional because it's
heavy-weight and hard to scale.

But I do agree with #1, so the idea seems good.


reply via email to

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