All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Avi Kivity <avi@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] Rethinking missed tick catchup
Date: Thu, 13 Sep 2012 17:22:28 +0300	[thread overview]
Message-ID: <20120913142228.GK20907@redhat.com> (raw)
In-Reply-To: <87r4q6xbiy.fsf@codemonkey.ws>

On Thu, Sep 13, 2012 at 09:06:29AM -0500, Anthony Liguori wrote:
> "Daniel P. Berrange" <berrange@redhat.com> writes:
> 
> > On Thu, Sep 13, 2012 at 07:14:08AM -0600, Eric Blake wrote:
> >> On 09/13/2012 04:49 AM, Gleb Natapov wrote:
> >> >> They do if you hibernate your laptop.
> >> >>
> >> > AFAIK libvirt migrates vm into a file on hibernate. It is better to move to S3
> >> > (using qemu-ga) instead and migrate to file only if s3 fails.
> >> 
> >> On host hibernate, libvirt currently does nothing to the guest.  When
> >> the host resumes, the guests see a large gap in execution.
> >> 
> >> Libvirt would need a hook into host hibernation, to have enough time to
> >> tell the guests to go into S3 prior to allowing the host to go into S3.
> >> 
> >> On host reboot, libvirt currently saves guests to disk using migrate to
> >> file.  The ideal solution would be to first tell the guest to go into S3
> >> before migrating to file, but the migration to file STILL must occur,
> >> because the host is about to reboot and S3 is not persistent.  S3 is a
> >> better solution than S4, in that S4 requires the guest to have enough
> >> memory (and if it doesn't cooperate, data is lost), but with S3, even if
> >> the guest doesn't cooperate, we can still fall back to migration to file
> >> with the guest only losing time, but not data.
> >
> > Trying to hook into host S3/S4 and do magic to the guests is just
> > asking for trouble. Not only can it arbitrarily delay the host going
> > into S3/S4, but it is not reliable in general, even for OS which do
> > support it. Much better off hooking into the resume path on the host
> > and issuing a QEMU GA call to each running guest to resync their
> > clocks
> 
> I think it's better for QEMU to talk to qemu-ga.  We can tell when a large
> period of time has passed in QEMU because we'll accumulate a large
> number of missed ticks.
> 
With RTC configured to use vm clock we will not.

> This could happen because of stop, host suspend, live migration to a
> file, etc.
> 
> It's much easier for us to call into qemu-ga to do the time correction
> whenever this event occurs than to try and have libvirt figure out when
> it's necessary.
And if guest does not have qemu-ga what is better inject interrupts like
crazy for next 2 minutes or leave guest with incorrect time?

> 
> We know exactly when it's necessary, libvirt would need to guess.
> 
> Yes, we could generate a QMP event when a large skew was dedicated, but
> I think this could happen often enough that it would be problematic.
> Since QEMU is already implementing policy doing timer catchup in the
> first place, I think we probably should own time catchup policy entirely.
> 
> Regards,
> 
> Anthony Liguori
> 
> >
> > Regards,
> > Daniel
> > -- 
> > |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> > |: http://libvirt.org              -o-             http://virt-manager.org :|
> > |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> > |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
			Gleb.

  reply	other threads:[~2012-09-13 14:22 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 13:54 [Qemu-devel] Rethinking missed tick catchup Anthony Liguori
2012-09-12 14:21 ` Jan Kiszka
2012-09-12 14:44   ` Anthony Liguori
2012-09-12 14:50     ` Jan Kiszka
2012-09-12 15:06     ` Gleb Natapov
2012-09-12 15:42       ` Jan Kiszka
2012-09-12 15:45         ` Gleb Natapov
2012-09-12 16:16       ` Gleb Natapov
2012-09-12 15:15 ` Gleb Natapov
2012-09-12 18:19   ` Anthony Liguori
2012-09-13 10:49     ` Gleb Natapov
2012-09-13 13:14       ` Eric Blake
2012-09-13 13:28         ` Daniel P. Berrange
2012-09-13 14:06           ` Anthony Liguori
2012-09-13 14:22             ` Gleb Natapov [this message]
2012-09-13 14:34               ` Avi Kivity
2012-09-13 14:42                 ` Eric Blake
2012-09-13 15:40                   ` Avi Kivity
2012-09-13 15:50                     ` Anthony Liguori
2012-09-13 15:53                       ` Avi Kivity
2012-09-13 18:27                         ` Anthony Liguori
2012-09-16 10:05                           ` Avi Kivity
2012-09-16 14:37                             ` Anthony Liguori
2012-09-19 15:34                               ` Avi Kivity
2012-09-19 16:37                                 ` Gleb Natapov
2012-09-19 16:44                                   ` Avi Kivity
2012-09-19 16:55                                     ` Gleb Natapov
2012-09-19 16:57                                       ` Avi Kivity
2012-09-13 14:35               ` Anthony Liguori
2012-09-13 14:48                 ` Gleb Natapov
2012-09-13 15:51                   ` Avi Kivity
2012-09-13 15:56                   ` Anthony Liguori
2012-09-13 16:06                     ` Gleb Natapov
2012-09-13 18:33                       ` Anthony Liguori
2012-09-13 18:56                         ` Gleb Natapov
2012-09-13 20:06                           ` Anthony Liguori
2012-09-13 16:08                     ` Avi Kivity
2012-09-13 13:47         ` Gleb Natapov
2012-09-12 16:27 ` Stefan Weil
2012-09-12 16:45   ` Gleb Natapov
2012-09-12 17:30     ` Stefan Weil
2012-09-12 18:13       ` Gleb Natapov
2012-09-12 19:45         ` Stefan Weil
2012-09-13 10:50           ` Gleb Natapov
2012-09-12 20:06       ` Michael Roth
2012-09-12 17:23 ` Luiz Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2012-09-12 18:03 Clemens Kolbitsch
2012-09-13  6:25 ` 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=20120913142228.GK20907@redhat.com \
    --to=gleb@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.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.