From: Marcelo Tosatti <mtosatti@redhat.com>
To: Eran Rom <eranr@il.ibm.com>,
Glauber de Oliveira Costa <gcosta@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: guest gettimeofday behavior
Date: Tue, 7 Jul 2009 17:12:16 -0300 [thread overview]
Message-ID: <20090707201216.GA9129@amt.cnet> (raw)
In-Reply-To: <loom.20090707T081402-628@post.gmane.org>
On Tue, Jul 07, 2009 at 09:58:46AM +0000, Eran Rom wrote:
> Eran Rom <eranr <at> il.ibm.com> writes:
>
> >
> > Eran Rom <eranr <at> il.ibm.com> writes:
> >
> > Still getting a misbehaving clock:
> > guest uses kvmclock with kernel 2.6.27
> > host kernel is 2.6.27 with kvm-qemu-87 & kvm-kmod-87
> >
> > getting:
> > ...
> > now = 2128043797
> > now = 2138048010
> > now = 18446744071562636328
> >
Eran,
This was happening with kvmclock back then when it did not handle
cpu frequency changes. What are the details of the host hw?
Glauber, any clues?
> Below is the exact code used.
> Also, I use a script in the host to run this code in a loop for 5 minutes, each
> time in a newly launched guest. This happens on average once every 10 executions.
>
> Thanks very much,
> Eran
>
> #include <sys/time.h>
> #include <time.h>
>
> int main(int argc, char **argv)
> {
> int seconds;
> unsigned long long now, goal;
> struct timeval time1, time2;
>
> if (argc != 2)
> return;
>
> seconds = atoi(argv[1]);
>
> gettimeofday(&time1, NULL);
> now = ((time1.tv_sec) * 1000000) + time1.tv_usec;
> goal = now + (seconds * 1000000);
> while (now < goal) {
> sleep(10);
> gettimeofday(&time2, NULL);
> now = (time2.tv_sec * 1000000) + time2.tv_usec;
> }
> }
next prev parent reply other threads:[~2009-07-07 20:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-25 13:25 guest gettimeofday behavior Eran Rom
2009-06-28 8:58 ` Dor Laor
2009-06-29 19:11 ` Eran Rom
2009-06-30 6:54 ` Avi Kivity
2009-06-30 7:48 ` Eran Rom
2009-07-06 8:24 ` Eran Rom
2009-07-07 9:58 ` Eran Rom
2009-07-07 20:12 ` Marcelo Tosatti [this message]
2009-07-08 11:51 ` Glauber Costa
2009-07-08 14:07 ` Eran Rom
2009-07-13 7:55 ` Eran Rom
2009-07-16 6:24 ` Eran Rom
2009-06-28 10:45 ` Avi Kivity
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=20090707201216.GA9129@amt.cnet \
--to=mtosatti@redhat.com \
--cc=eranr@il.ibm.com \
--cc=gcosta@redhat.com \
--cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox