[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
Re: [Qemu-devel] [RFC for-2.7] block: keep AioContext pointer in BlockBackend
Tue, 10 May 2016 10:33:33 +0100
On Mon, May 09, 2016 at 06:48:12PM +0200, Paolo Bonzini wrote:
> 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.
I agree that lightweight options are nicer. Should I resend without #2
in the commit description?
Description: PGP signature