Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: ya su <suya94335@gmail.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Kevin Wolf <kwolf@redhat.com>
Subject: Re: problem about blocked monitor when disk image on NFS can not be reached.
Date: Tue, 01 Mar 2011 17:23:23 +0200	[thread overview]
Message-ID: <4D6D0F6B.7030609@redhat.com> (raw)
In-Reply-To: <AANLkTi=348iyAME5BFpaQOQOHP3=dyq41o0oubP_X7MX@mail.gmail.com>

On 03/01/2011 05:01 PM, Stefan Hajnoczi wrote:
> On Tue, Mar 1, 2011 at 12:39 PM, ya su<suya94335@gmail.com>  wrote:
> >      how about to remove kvm_handle_io/handle_mmio in kvm_run function
> >  into kvm_main_loop, as these operation belong to io operation, this
> >  will remove the qemu_mutux between the 2 threads. is this an
> >  reasonable thought?
> >
> >      In order to keep the monitor to response to user quicker under
> >  this suition, an easier way is to take monito io out of qemu_mutux
> >  protection. this include vnc/serial/telnet io related with monitor,
> >  as these io will not affect the running of vm itself, it need not in
> >  so stirct protection.
>
> The qemu_mutex protects all QEMU global state.  The monitor does some
> I/O and parsing which is not necessarily global state but once it
> begins actually performing the command you sent, access to global
> state will be required (pretty much any monitor command will operate
> on global state).
>
> I think there are two options for handling NFS hangs:
> 1. Ensure that QEMU is never put to sleep by NFS for disk images.  The
> guest continues executing, may time out and notice that storage is
> unavailable.

That's the NFS soft mount option.

> 2. Pause the VM but keep the monitor running if a timeout error
> occurs.  Not sure if there is a timeout from NFS that we can detect.

The default setting (hard mount) will retry forever in the kernel.  
Moreover, the other default setting (nointr) means we can't even signal 
the hung thread.

> For I/O errors (e.g. running out of disk space on the host) there is a
> configurable policy.  You can choose whether to return an error to the
> guest or to pause the VM.  I think we should treat NFS hangs as an
> extension to this and as a block layer problem rather than an io
> thread problem.

I agree.  Mount the share as a soft,intr mount and let the kernel time 
out and return an I/O error.

> Can you get backtraces when KVM hangs (gdb command: thread apply all
> bt)?  It would be interesting to see some of the blocking cases that
> you are hitting.

Won't work (at least under the default configuration) since those 
threads are uninterruptible.  At the very least you need an 
interruptible mount.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2011-03-01 15:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01  5:01 problem about blocked monitor when disk image on NFS can not be reached ya su
2011-03-01 10:51 ` Stefan Hajnoczi
2011-03-01 12:39   ` ya su
2011-03-01 15:01     ` Stefan Hajnoczi
2011-03-01 15:23       ` Avi Kivity [this message]
2011-03-02 10:39         ` ya su
2011-03-02 17:26           ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2011-02-28 13:52 ya su

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=4D6D0F6B.7030609@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=stefanha@gmail.com \
    --cc=suya94335@gmail.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