All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: armbru@redhat.com, xiecl.fnst@cn.fujitsu.com,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] lock-free monitor?
Date: Sun, 14 Feb 2016 14:22:10 +0800	[thread overview]
Message-ID: <20160214062210.GD9723@ad.usersys.redhat.com> (raw)
In-Reply-To: <20160209134706.GE6510@stefanha-x1.localdomain>

On Tue, 02/09 13:47, Stefan Hajnoczi wrote:
> On Mon, Feb 08, 2016 at 03:17:23PM +0000, Dr. David Alan Gilbert wrote:
> > Does this make sense to everyone else, or does anyone have any better
> > suggestions?
> 
> As a concrete example, any monitor command that calls bdrv_drain_all()
> can hang forever with the QEMU global mutex held if I/O requests are
> stuck (e.g. NFS mount is unreachable).
> 
> bdrv_aio_cancel() can also hang but is mostly exposed to device
> emulation, not the monitor.
> 
> One solution for these block layer functions is to add a timeout
> argument and let them return an error.  This way the monitor and device
> emulation do not hang forever.

Yes, there are a few places in block layer invoking aio_poll() in a loop
waiting for certain events, and a disconnected network link could make QEMU
hang. In these cases a timeout is a huge improvement.  Maybe we can mark the
BDS as "hanging" (-EIO is returned for all further requests) and let
bdrv_drain_all() return.

> 
> The benefit of the timeout is that both monitor and device emulation
> hangs are tackled.  It also doesn't require monitor changes.
> 
> I'm not sure who chooses the timeout value and which value makes sense
> (policy vs mechanism separation)...

Default to 30 seconds like Linux, and make it tunable through command line
options as well as QMP?

Fam

  parent reply	other threads:[~2016-02-14  6:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 15:17 [Qemu-devel] lock-free monitor? Dr. David Alan Gilbert
2016-02-09 13:47 ` Stefan Hajnoczi
2016-02-09 13:52   ` Dr. David Alan Gilbert
2016-02-14  6:22   ` Fam Zheng [this message]
2016-02-15 13:42     ` Stefan Hajnoczi
2016-02-15 14:19       ` Markus Armbruster
2016-02-15 12:59   ` Kevin Wolf
2016-02-09 16:57 ` Markus Armbruster
2016-02-10  8:52   ` Dr. David Alan Gilbert
2016-02-10 15:12     ` Markus Armbruster
2016-02-10 15:33       ` Dr. David Alan Gilbert
2016-02-11  8:33         ` Markus Armbruster

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=20160214062210.GD9723@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiecl.fnst@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.