3 ms·
> Instead of being a benefit to testing, what our investigation found is that when HPET is forced as the sole system timer, it can sometimes a hindrance to sys
by amluto 9y ago
> Instead of being a benefit to testing, what our investigation found is that when HPET is forced as the sole system timer, it can sometimes a hindrance to system performance, particularly gaming performance.
That doesn’t surprise me at all. The HPET is awful. Reading it takes thousands of cycles. Reading it concurrently on multiple cores is even worse. Even using it as a timer (to fire an interrupt at a given time) is highly dubious — IIRC it only supports “interrupt of time == X” and not “interrupt the first time that time >= X”, which means that setting a timer without races requires manually checking that the timeout hasn’t already expired after programming the timer, which is extra bad given how incredibly slow the HPET is.
(I maintain the Linux vDSO, and the HPET has so many problems that I disabled vDSO HPET support entirely a while back.)
- cesarb 9y ago> (I maintain the Linux vDSO, and the HPET has so many problems that I disabled vDSO HPET support entirely a while back.) For those who don't know: the vDSO is a "dynamic library" provided by the Linux kernel to every process. System calls in modern Linux are made by calling a function exported by the vDSO, which then does the real system call, using the fastest method available. There are a few special cases in the vDSO for time-related system calls: depending on the currently active clock source, it can do a few calculations and return, without having to actually do a system call. This makes getting the current time much faster.