[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] xen PIT timer
On 23 Sep 2005, at 20:49, Ryan Harper wrote: Why does Xen chose to use mode 0, on PIT CH2 for calculating how much time has passed rather than how Linux using PIT_CH0 in mode 2? Are there some trade offs? The way we track time in Xen is completely different to Linux. Linux tracks time off periodic interrupts from PIT_CH0: initially assuming each tick is 10ms but allowing that to be trimmed by adjtimex if ntpd is running. Xen only uses PIT_CH0 as a fallback timer on uniprocessor systems with no local APIC: aprt from that it is basically unused. Xen doesn't rely on fixed periodic interrupts -- instead programming the local APIC timer to the next event of interest. We track time by assuming the PIT crystal is a precise 1.119380Mhz source: we can therefore measure the passage of time by reading how far PIT_CH2 has decremented and perform a multiplication. To more quickly estimate the passage of time, each CPU calibrates its local APIC oscillator to PIT_CH2 -- we can then estimate time-of-day with a RDTSC instruction + multiplication. The main problem with using PIT as platform timer is that the counters are only 16 bits. We therefore periodically (every few 10s of ms) read the PIT_CH2 delta out into a wider 64-bit variable. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |