All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Winchell <dwinchell@virtualiron.com>
To: "dan.magenheimer@oracle.com" <dan.magenheimer@oracle.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Deepak Patel <deepak.patel@oracle.com>,
	Dave Winchell <dwinchell@virtualiron.com>
Subject: (progress on hpet accuracy) and Re: [PATCH] Add a timer mode that disables pending missed ticks
Date: Mon, 25 Feb 2008 15:01:19 -0500	[thread overview]
Message-ID: <47C31E8F.90805@virtualiron.com> (raw)
In-Reply-To: <20080225094202546.00000003172@djm-pc>

Hi Dan,

I've added a few comments below ...

Lately I've been busy getting the hpet emulation to be accurate.
Right now I have the hpet based clock error down to under .02% with
a limited amount of testing. (The error was 1% or more before my changes.)
I hope to submit a patch soon so others can try this out. I need to do more
testing and reduce my changes to the minimal set required.

One thing I really like about the hpet is that a test designed to see if
the clock will go backwards passes on the hpet where it fails on
the pit/tsc clock. I tried for quite a while to keep pit/tsc from going
backwards, but was unsuccessful. It ended up being easier to fix the hpet
emulation for accuracy.

The clock going backwards test is simply a call to gettimeofday() in a loop,
with no delay between calls except to check for new_time < prev_time.
I run this from a driver calling do_gettimeofday() to make it
more stressful. Then I run an instance of this on all (8) vcpus on
8 physical * 2 guests for a total of 16 vcpus running the test.
The test does a yield now and then so you can actually log into the 
system, etc.

Regards,
Dave

Dan Magenheimer wrote:

>Hi Dave --
>
>I've looked into RHEL5-64 a bit more and would appreciate
>any thoughts you might have:
>
>  
>
>>>So, some open questions:
>>>[2] In RHEL5, I *think* it is the WALL source that we care about?
>>>
>>>
>>>      
>>>
>>I'll have to check on this too.
>>    
>>
>
>On second look, I may be wrong.  The GTOD clock seems to be
>the one associated with vxtime.mode and vxtime.mode is used in
>linux-2.6.18.8/arch/x86_64/kernel/time.c:main_timer_handler() to
>determine if a tick is lost or not.  Is this the code that we
>want timer_mode=2 to influence?
>  
>
Yes, it is.

>  
>
>>>[1] Is notsc necessary for proper ticks for RHEL4-32/RHEL5-64?
>>>   (I *think* not as it has never come up in any email.)
>>>
>>>
>>>      
>>>
>>I have not investigated this yet.
>>    
>>
>
>Well for RHEL5-64, looking at linux-2.6.18.8/arch/x86_64/kernel/time.c,
>it appears whether notsc is required or not depends in part on the
>underlying virtual AND physical system.
>
>notsc definitely is involved in the selection of GTOD time
>but notsc can get set not only by kernel command line parameter
>but also by the result of unsynchronized_tsc():
>  
>
According to the comment in time.c, unsynchronized_tsc() is guessing
whether the tsc is synchronized across processors. On most physical 
platforms they are,
and, on those physical platforms the virtualization layer will present the
same error as the hardware exibits. Right now we don't have code in xen to
make a unsynchronized host look synchronized to the guest, though that
wouldn't be very hard to do as long as the error between physical processors
remained constant.

>if (apic_is_clustered_box) notsc=1
>if (box_is_Intel) {
>	/* C3 delay is worst case HW latency to enter/exit C3 state */
>	if (C3 delay < 1000) notsc=1
>}
>else { /* e.g. AMD */
>	if (num_present_cpus() > 1) notsc=1
>}
>
>I'm not sure what constitutes a clustered HVM guest or how that
>C3 state latency is determined under Xen, but its clear that the
>clocksource can be influenced not only by what clock hardware is
>present and command-line parameters but also by the physical CPU
>and number of guest vcpus.
>  
>
I haven't looked into

>Yuck!
>
>Thanks,
>Dan
>
>
>
>  
>

  reply	other threads:[~2008-02-25 20:01 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30 14:28 [PATCH] Add a timer mode that disables pending missed ticks Shan, Haitao
2007-10-30 16:12 ` Keir Fraser
2007-10-30 21:16   ` Dave Winchell
2007-10-31  7:09     ` Keir Fraser
2007-11-01 21:14       ` Dave Winchell
2007-11-01 21:21         ` Dave Winchell
2007-11-02  9:40         ` Keir Fraser
2007-11-02 15:51           ` Dave Winchell
2007-11-02 16:14             ` Keir Fraser
2007-11-02 16:35               ` Keir Fraser
2007-11-02 18:05               ` Dave Winchell
2007-11-03 21:17                 ` Dave Winchell
2007-11-03 22:31                   ` Keir Fraser
2007-11-05 14:36                     ` Dave Winchell
2007-11-07 14:39                       ` Dave Winchell
2007-11-07 14:39                         ` Keir Fraser
2007-11-07 16:23                           ` Dave Winchell
2007-11-07 17:10                             ` Keir Fraser
2007-11-07 17:29                               ` Keir Fraser
2007-11-07 17:47                                 ` Keir Fraser
2007-11-07 19:38                                   ` Dave Winchell
2007-11-08  8:07                                     ` Keir Fraser
2007-11-08 14:43                                       ` Dave Winchell
2007-11-08 14:53                                         ` Keir Fraser
2007-11-08 15:08                                           ` Dave Winchell
2007-11-09 19:22                                           ` Dave Winchell
2007-11-10 10:55                                             ` Keir Fraser
2007-11-12 15:37                                               ` Dave Winchell
2007-11-26 20:57                                               ` Dave Winchell
2007-12-06 11:57                                                 ` Keir Fraser
2007-12-19 18:57                                                   ` Dan Magenheimer
2007-12-19 19:32                                                     ` Dave Winchell
2008-01-03 22:57                                                       ` Dan Magenheimer
2008-01-03 23:24                                                         ` Dave Winchell
2008-01-04 23:24                                                         ` Dave Winchell
2008-01-08 14:33                                                           ` Keir Fraser
2008-01-09 16:53                                                             ` Dave Winchell
2008-01-09 17:19                                                               ` Dan Magenheimer
2008-01-09 19:14                                                                 ` Keir Fraser
2008-01-25 23:50                                                               ` Dan Magenheimer
2008-01-27 21:21                                                                 ` Dave Winchell
2008-01-28  0:29                                                                   ` Dan Magenheimer
2008-01-28 15:21                                                                     ` Dave Winchell
2008-01-29 22:34                                                                       ` Dan Magenheimer
2008-01-30 15:25                                                                         ` Dave Winchell
2008-01-30 21:04                                                                           ` Deepak Patel
2008-01-30 21:44                                                                             ` Dave Winchell
2008-02-01 22:31                                                                               ` Dan Magenheimer
2008-02-04 20:07                                                                                 ` Dave Winchell
2008-02-08 21:21                                                                                   ` Dave Winchell
2008-02-11 16:52                                                                                     ` Dave Winchell
2008-02-14 15:59                                                                                       ` Dave Winchell
2008-02-14 16:21                                                                                         ` Dan Magenheimer
2008-02-14 17:55                                                                                           ` Dave Winchell
2008-02-15 16:46                                                                                             ` Dan Magenheimer
2008-02-15 17:28                                                                                               ` Dave Winchell
2008-02-19 15:26                                                                                                 ` Dave Winchell
2008-02-19 17:55                                                                                                   ` Dan Magenheimer
2008-02-19 19:29                                                                                                     ` Keir Fraser
2008-02-19 20:50                                                                                                     ` Dave Winchell
2008-02-19 23:38                                                                                                       ` Dan Magenheimer
2008-02-20 23:40                                                                                                         ` Dan Magenheimer
2008-02-25 16:42                                                                                                       ` Dan Magenheimer
2008-02-25 20:01                                                                                                         ` Dave Winchell [this message]
2008-02-26  8:26                                                                                                           ` (progress on hpet accuracy) and " Keir Fraser
2008-02-26 14:45                                                                                                             ` Dave Winchell
2008-02-26 14:56                                                                                                               ` Keir Fraser
2008-02-26 15:49                                                                                                                 ` Dave Winchell
2008-03-05 15:06                                                                                                                 ` Dave Winchell
2008-03-05 15:20                                                                                                                   ` Keir Fraser
2008-03-05 17:25                                                                                                                     ` Dave Winchell
2008-03-05 17:21                                                                                                                       ` Keir Fraser
2008-03-05 17:42                                                                                                                         ` Dave Winchell
2008-03-05 17:53                                                                                                                           ` Dan Magenheimer
2008-03-06 23:36                                                                                                         ` Dan Magenheimer
2007-12-19 19:40                                                     ` Dave Winchell
2007-11-08 14:57                                         ` Dave Winchell
2007-10-31  3:10   ` Shan, Haitao

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=47C31E8F.90805@virtualiron.com \
    --to=dwinchell@virtualiron.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=deepak.patel@oracle.com \
    --cc=xen-devel@lists.xensource.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 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.