From: Dor Laor <dlaor@redhat.com>
To: Eran Rom <eranr@il.ibm.com>
Cc: kvm@vger.kernel.org
Subject: Re: guest gettimeofday behavior
Date: Sun, 28 Jun 2009 11:58:33 +0300 [thread overview]
Message-ID: <4A4730B9.1090902@redhat.com> (raw)
In-Reply-To: <loom.20090625T130343-552@post.gmane.org>
On 06/25/2009 04:25 PM, Eran Rom wrote:
> Hi All,
> Am a newbie (to kvm, linux kernel, git, etc.) so apologize in advance for
> missing/inaccurate info.
> I am experiencing inconsistent behavior of guest gettimeofday, described below.
> I have seen prior reference to the problem, however, it was not clear whether
> the issue was solved or not and where.
>
> Below is a description of my setup and the behavior I see.
> Another question is whether oprofile with timer mode would suffer from the same
> problem?
>
> Otherwise I saw that kvm-85 has "generic performance counter msr handling", does
> this mean that oprofile can be executed without the timer mode?
>
> Thanks very much,
> Eran
>
> Setup:
> Guest 32 bit ubuntu with 2.6.27 kernel
> Host 64 bit Suse 10.2 with 2.6.27 kernel
> 1 quadcore Intel Xeon CPU
> I am not sure about the kvm userspace code version.
> Used git to create a repository, and then did
> git checkout kvm-updates-2.6.27 (is that fixed in time?)
>
> Behavior:
> Running a code doing:
> t1 = gettimeofday
> t2 = gettimeofday
> while t2-t1< 5 minutes {
> sleep(1)
> t2 = gettimeofday
> }
>
> Ran it 10 times, each time in a 'newly launched' VM, halting it after the test.
> 8 out of 10 times the wall clock showed 5 minutes
> 1 time 4 minutes and 40 seconds
> 1 time 0 seconds
>
I'm not sure what's your 'wall clock' value, there is not printf in your
script.
Nevertheless, the tsc clock is not reliable, the host can scale it, or
go into
deep sleep state.
So either use newer kernel with kvmclock (pv) or change the clock source
into rtc/pit
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2009-06-28 8:58 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 [this message]
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
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=4A4730B9.1090902@redhat.com \
--to=dlaor@redhat.com \
--cc=eranr@il.ibm.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