Timer in vitual machine

Source: Internet
Author: User
Tags event timer

http://support.microsoft.com/kb/918461

A virtual machine generally has difficulty synchronizing its time with the physical host computer. Although Microsoft Virtual Server Machine Virtual Additions are intended to help correct this problem, for you might expe Rience time synchronization problems because of the way in which the guest operating system keeps track to the system time . Every kind of operating system has its own way to keep of the system time. The Linux 2.6 kernel uses three different kinds of algorithms to keep for the system time. These algorithms are more efficient than the algorithms that are used by the Linux 2.4 kernel and by earlier Linux kernels . Back to the topTime synchronization in a virtual machineAn operating system generally tracks the "Periodic time interrupts" are generated by a specific Device. Generally, a operating system obtains the time from a battery-backed complimentary Metal oxide semi-conductor (CMOS) cloc K During the operating system ' s startup procedure. The operating system then configures a timer device to generate periodic. The operating system keeps track of time by counting these interrupts.

For a virtual machine, the actual physical hardware are shared by the host operating system and by the guest operating Sys Tem. When a is virtual machine generates a time interrupt, the guest operating system may is running or May is running. Therefore, the guest operating system does not immediately account for some of these interrupts. To work around this issue, the virtual machine keeps a backlog of these interrupts. Additionally, the virtual machine increases the frequency of timer interrupts when it is running. The increased frequency of timer interrupts is intended to help the guest operating system maintain the correct time. However, the increased frequency of this interrupts could cause the guest operating system to miss some of the interrupts . These missed interrupts are known as "lost ticks." Lost ticks cause the guest operating system time to lag behind the actual time. Although you could experience this issue on a physical computer, your are more likely to experience this ISSUE in a guest operating system this is running on a virtual machine.

The Linux 2.4 kernel and earlier Linux kernels rely on the timer interrupts this are by the timer. The algorithms that are implemented for time synchronization in the Linux 2.4 kernel does not account for lost ticks. This behavior may cause the Linux guest operating system time to lag behind the actual clock. To help resolve this issue, some Linux distributions patch the Linux 2.4 kernel to deliver timer interrupts at a faster RA Te. However, the Linux guest operating system could still experience time synchronization issues because of lost.

The Linux 2.6 kernel implements more efficient algorithms to resolve this time synchronization issue. Unlike the Linux 2.4 algorithms, the Linux 2.6 algorithms adjust for lost. However, this adjustment may cause the linux-based virtual machine to gain time. The Linux 2.6 kernel has three different clock parameters that can is passed to the kernel at boot time. Use this parameters to select the ' algorithms to ' to ' use for time synchronization. For more information about this algorithms, the "Timekeeping in Linux" section. Each of these timekeeping algorithms has advantages and disadvantages. However, you are the likely to notice disadvantages on a virtual machine on a than physical.Computer Timer HardwareEvery operating system has its own method to handle timekeeping. There are various kinds of timer mechanisms that are used to keep time on a computer. These timer mechanisms include the following:programmable Interval timer (PIT) CMOS Real Time Clock (RTC) Local Advanced Programmable Interrupt Controller (APIC) Timers Advanced Configuration and Power Interface (ACPI) (This mechanism is also Known as a chipset Timer.) Time Stamp Counter (TSC) high Precision Event Timer (Hpet)timekeeping in LinuxOn a x86-based platform, the Linux 2.6 kernel interacts with the following kinds of clocks to keep of:Power Management Timer (PMTMR)
This clock has the following characteristics:this clock are set by using theCLOCK=PMTMRKernel parameter. This clock uses the ACPI timer. This clock could cause smaller time gains.Time Stamp Counter (TSC)
This clock has the following characteristics:this clock are set by using theCLOCK=TSCKernel parameter. (This is the default parameter.) This is clock uses the PIT counter and the TSC for time interpolation. This clock could cause overcorrection in a virtual machine environment. Therefore, the guest operating system clock may run too fast. This clock could cause time gains of the up to ten percent.programmable Interval Timer (PIT)
This clock has the following characteristics:this clock are set by using theClock=pitKernel parameter. This clock uses is only the PIT counter to time interpolation. This clock uses the simplest of the available algorithms. This clock does is not gain time because it does does use lost tick code. For more information about Virtual Server visit, the following Microsoft Web Site:http://www.microsoft.com/windowsse Rversystem/virtualserver/default.mspx (http://www.microsoft.com/windowsserversystem/virtualserver/default.mspx) The Third-party products, this is article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of this products.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.