All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: xiecl.fnst@cn.fujitsu.com, armbru@redhat.com, stefanha@redhat.com
Subject: [Qemu-devel] lock-free monitor?
Date: Mon, 8 Feb 2016 15:17:23 +0000	[thread overview]
Message-ID: <20160208151722.GB3022@work-vm> (raw)

Hi,
  I wondered what it would take to be able to do a lock-free monitor;
i.e. one that could respond to (some) commands while the qemu big lock is held.

My reason for asking is that there are cases in migration and colo
where a network block device has failed and is blocking, but it fails
at just the wrong time while the lock is held, and now, you don't have
any way to unblock it since you can't do anything on the monitors.
If I could issue a command then I could have it end up doing a shutdown(2)
on the network connection and free things up.

Maybe this would also help real-time people?

I was thinking then, we could:
   a) Have a monitor that wasn't tied to the main loop at all - each instance
would be it's own thread and have it's own poll() (probably using the new
IO channels?)
   b) for most commands it would take the big lock before execute the command
and release it afterwards - so there would be no risk in those commands.
   c) Some commands you could mark as 'lock free' - they would be required
not to take any locks or wait for *anything* and for those the monitor would
not take the lock.
   d) Perhaps have some way of restricting a particular monitor session to only
allowing non-blocking commands.
   e) Then I'd have to have a way of finding the broken device in a lockfree
way (RTU list walk?) and issuing the shutdown(2).

Bonus points to anyone who can statically check commands in (c).

Does this make sense to everyone else, or does anyone have any better
suggestions?

Dave

--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

             reply	other threads:[~2016-02-08 15:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 15:17 Dr. David Alan Gilbert [this message]
2016-02-09 13:47 ` [Qemu-devel] lock-free monitor? Stefan Hajnoczi
2016-02-09 13:52   ` Dr. David Alan Gilbert
2016-02-14  6:22   ` Fam Zheng
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=20160208151722.GB3022@work-vm \
    --to=dgilbert@redhat.com \
    --cc=armbru@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.