All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused
Date: Wed, 05 Oct 2011 19:12:56 +0200	[thread overview]
Message-ID: <4E8C9018.5000908@redhat.com> (raw)
In-Reply-To: <4E8C8A9C.7090506@web.de>

On 10/05/2011 06:49 PM, Jan Kiszka wrote:
> On 2011-10-05 18:37, Avi Kivity wrote:
> >  On 10/05/2011 06:31 PM, Jan Kiszka wrote:
> >>  >>
> >>  >
> >>  >   vm_start() should be symmetric with vm_stop().  That is, if a piece of
> >>  >   code wants to execute with vcpus stopped, it should just run inside a
> >>  >   stop/start pair.
> >>  >
> >>  >   The only confusion can come from the user, if he sees multiple stop
> >>  >   events and expects that just one cont will continue the vm.  For the
> >>  >   machine monitor, we should just document that the you have to issue
> >>  one
> >>  >   cont for every stop event you see (plus any stops you issue).  It's
> >>  not
> >>  >   unnatural - the code that handles a stop_due_to_enospace can work
> >>  to fix
> >>  >   the error and issue a cont, disregarding any other stops in progress
> >>  >   (due to a user pressing the stop button, or migration, or cpu hotplug,
> >>  >   or whatever).  For the human monitor, it's not so intuitive, but the
> >>  >   situation is so rare we can just rely on the user to issue cont again.
> >>
> >>  Making this kind of user-visible change would be a bad idea.
> >
> >  The current situation is a bad idea.
> >
> >  Consider a user-initiated or qemu-initiated stop; the user starts to
> >  deal with it, types 'cont', and as the Enter key is being depressed
> >  another qemu-initiated stop comes along.  The 'cont' restarts the guest
> >  even though the second event was not dealt with.
>
> You always have this kind of problems when you attach two keyboards to
> the same console. A counting stop/cont will just create different
> effects of the same problem but not solve it.

Let's examine a concrete example: a user is debugging a guest, which 
stops at a breakpoint.  Meanwhile a live migration is going on, 
involving internal stops.  When the guest does manage to run for a bit, 
it runs out of disk space, generating a stop, which the management agent 
resolves by allocating more space and issuing a cont.

With a counting cont, no matter in what order these events happen, 
things work out fine.  How do they work out with your proposal?

> >
> >>  We are talking about multiple stop states here, but only a single
> >>  function (vm_stop) to enter them - maybe that's not optimal. But the
> >>  point is that we were missing one stop-to-stop transition. And that
> >>  needs to be fixed, either inside vm_stop or when it is called.
> >
> >  Those stops are orthogonal.  There is no relationship between a
> >  migration stop, a user stop, an ENOSPC stop, a hotplug stop, and a
> >  debugger stop.  There is no reason to start inventing stop-to-stop
> >  transitions between them.  A 'cont' intended for one should not undo
> >  another.
>
> No, they aren't. They are all different states, and we need to model
> transitions between them. If there are redundant states, lets collapse them.

What's the state caused by 'stopped-due-to-migration-phase-3' and 
'stopped-due-to-breakpoint'? 
'stopped-due-to-migration-phase-3-and-breakpoint'?

> >>
> >
> >  Which stop states would these be?  When would you want one cont to undo
> >  two stops?
>
> No, cont would remain cont: the resume-after-stop command.
>
> Locking would never be user-exposed. It would be a QEMU-internal thing,
> used when there must be no resume for a certain finite while (e.g.
> during migration or savevm). I think one problem with the current state
> machine is that it does not differentiate between these two types of "stop".
>

My second proposal (a set of stop reasons) differentiates between all 
kinds of cont.  Maybe we should extend the monitor command to cont [reason].


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

  reply	other threads:[~2011-10-05 17:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 12:04 [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused Paolo Bonzini
2011-10-04 13:49 ` Luiz Capitulino
2011-10-04 14:09   ` Paolo Bonzini
2011-10-04 14:30     ` Luiz Capitulino
2011-10-05 14:37 ` Luiz Capitulino
2011-10-05 15:43   ` Avi Kivity
2011-10-05 15:44     ` Avi Kivity
2011-10-05 16:31     ` Jan Kiszka
2011-10-05 16:37       ` Avi Kivity
2011-10-05 16:49         ` Jan Kiszka
2011-10-05 17:12           ` Avi Kivity [this message]
2011-10-05 18:02             ` Jan Kiszka
2011-10-06 14:27               ` Avi Kivity
2011-10-06 15:08                 ` Jan Kiszka
2011-10-05 17:02         ` Luiz Capitulino
2011-10-05 17:23           ` Avi Kivity
2011-10-05 17:39             ` Luiz Capitulino
2011-10-05 18:02               ` Avi Kivity
2011-10-05 18:49                 ` Luiz Capitulino
2011-10-05 18:50                   ` Luiz Capitulino
2011-10-06 11:14                     ` Paolo Bonzini
2011-10-10 18:49 ` Luiz Capitulino

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=4E8C9018.5000908@redhat.com \
    --to=avi@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.