Welcome to MSDN Blogs Sign in | Join | Help

Negative ping times in Windows VM's - whats up?

Just a quick blog post that might help you resolve an issue that some customers have seen running under Hyper-V VM's.  The issue is negative ping times on multi-processor guests.

If you see negative ping times in multiprocessor W2k3 guest OSes you might consider setting the /usepmtimer in the boot.ini file. 

The root issue comes about from the Win32 QueryPerformanceCounter function.  By default it uses a time source called the TSC.  This is a CPU time source that essentially counts CPU cycles.  The TSC for each (virtual) processor can be different so there is no guarantee that reading TSC on one processor has anything to do with reading TSC on another processor.  This means back to back reads of TSC on different VP's can actually go backwards.  Hyper-V guarantees that TSC will not go backwards on a single VP.

So here the problem with negative ping times is the time source is using QueryPerformanceCounter which is using TSC.  By using the /usepmtimer boot.ini flag you change the time source for QueryPerformanceCounter from TSC to the PM timer which is a global time source.

  - Tony Voellm

Published Thursday, June 05, 2008 9:40 PM by tvoellm
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Negative ping times in Windows VM's - whats up?

Thursday, June 19, 2008 5:20 AM by eranb

Hi,

Is the PMTIMer virtualized per guest or is it routed (Via hyper-call) to a root partition reliable time source. If that is the case, what is the root partition time source (HPET,PMTimer,TSC,...)

Thanks,

Eran.

# re: Negative ping times in Windows VM's - whats up?

Thursday, June 19, 2008 5:20 AM by eranb

Hi,

Is the PMTIMer virtualized per guest or is it routed (Via hyper-call) to a root partition reliable time source. If that is the case, what is the root partition time source (HPET,PMTimer,TSC,...)

Thanks,

Eran.

# Problems with QueryPerformanceCounter on Windows Server 2003 Multi-Processor Hyper-V guests? Here’s why.

Wednesday, October 15, 2008 7:03 PM by Virtual Varia

A friend of mine from the Visual Studio group just came to me with an issue they’re having on some Windows

# Why does my Avg Disk Write / Sec counter keep climbing?

Wednesday, February 18, 2009 11:55 PM by ALL TOPICS PERFORMANCE

There have been a number of issues with time in W2k3 guests, the first of which was covered in http://blogs.msdn.com/tvoellm/archive/2008/06/05/negative-ping-times-in-windows-vm-s-whats-up.aspx

# How to ensure reliable performance data from VM's when using multiple virtual CPU's.

Thursday, February 19, 2009 2:19 PM by Vista knowledge from the OEM team and others...

If you're running Windows Server 2003 in a Hyper-V VM and have the VM configured to use multiple virtual

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker