qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [RFC for-2.7] block: keep AioContext pointer in BlockBackend
Date: Mon, 9 May 2016 18:48:12 +0200	[thread overview]
Message-ID: <5730BF4C.2080800@redhat.com> (raw)
In-Reply-To: <1460384056-29494-1-git-send-email-stefanha@redhat.com>



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.

Paolo

  reply	other threads:[~2016-05-09 16:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 14:14 [Qemu-devel] [RFC for-2.7] block: keep AioContext pointer in BlockBackend Stefan Hajnoczi
2016-05-09 16:48 ` Paolo Bonzini [this message]
2016-05-10  9:33   ` Stefan Hajnoczi
2016-05-10 10:38     ` Paolo Bonzini
2016-05-11 13:24       ` Stefan Hajnoczi
2016-05-17 10:52 ` Max Reitz
2016-05-17 11:07   ` Paolo Bonzini
2016-05-17 11:14     ` Max Reitz
2016-05-17 11:37       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5730BF4C.2080800@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).