On Wed, Sep 03, 2008 at 08:59:05PM -0700, Linus Torvalds wrote:15 years ago when I only knew DOS, I used the PIT a lot for precise delay calculations. I can attest that it can be a very precise timer for delays when you run busy loops. You even need very few ticks because you detect the falling edge with a high accuracy. Basically, I would do this : pit1 = readpit(); while (readpit() == pit1); t1 = rdtsc(); // precise beginning of tick 0 while (readpit() != pit1 - 5000); t2 = rdtsc(); // precise beginning of tick 5000 (t2 - t1) will be exactly 5000 PIT ticks long, or 4.1904767 ms. Additional sanity checks are needed of course, such as rollover detection, and a max loop counter in case we boot on a machine with a broken PIT. If someone wants to test this, I'd be interested in the number of ticks required to get a good accuracy, I bet that even with a few hundred ones it's already precise by a few ppm (about the precision of the input clock in fact). Willy --
| Satyam Sharma | Re: 2.6.23-rc6-mm1 |
| Chuck Ebbert | Why do so many machines need "noapic"? |
| Linus Torvalds | Linux 2.6.25-rc1 |
| Rafael J. Wysocki | [RFC][PATCH 0/3] PM: Rework suspend and hibernation code for devices (rev. 3) |
git: | |
| Martin Langhoff | Handling large files with GIT |
| Martin Langhoff | Re: git versus CVS (versus bk) |
| Junio C Hamano | Re: [PATCH 0/2] Making "git commit" to mean "git commit -a". |
| Pierre Habouzit | [PATCH] git-revert is one of the most misunderstood command in git, help users out. |
| Rui Miguel Silva Seabra | Re: That whole "Linux stealing our code" thing |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Marius ROMAN | 1440x900 resolution problem |
| Juan Miscaro | When will OpenBSD support UTF8? |
| Matheos Worku | 2.6.24 BUG: soft lockup - CPU#X |
| Daniel J Blueman | [sky2, solved] transmit timeouts and firmware update... |
| Octavian Purdila | [RFC] support for IEEE 1588 |
| Evgeniy Polyakov | [resend take 2 0/4] Distributed storage. |
