Re: RFD: nanoseconds, rdtsc and SMP

H. Peter Anvin (hpa@transmeta.com)
25 Feb 1999 09:25:29 GMT


Followup to: <BEAC82A40E2@rkdvmks1.ngate.uni-regensburg.de>
By author: "Ulrich Windl" <ulrich.windl@rz.uni-regensburg.de>
In newsgroup: linux.dev.kernel
>
> The question is: "what assumptions can be made?" On the i386
> architecture, will all cycle counters start at the same moment, and
> will they be bound to the same oscillator? If not one has to
> calibrate each CPU, and remember the cycle counter of each CPU during
> timer interrupt. When getting the time one must find the cycle
> counter of the own CPU and subtract that counter at the last
> interrupt to get the difference. Other architectures maybe even worse.
>
> Colin Plumb suggested to synchronize the cycle counters on i386
> architecture, assuming they'll remain in sync. This would make the
> time code much easier, but break things terrible, if the counters
> drift apart.
>

On the i386, at least currently, they will all operate in sync, but
may not start out from the same value (they are *supposed* to, but it
turns out to be buggy in practice.)

-hpa

-- 
"Linux is a very complete and sophisticated operating system.  There
are, and will be, large numbers of applications available for it."
    -- Paul Maritz, Group Vice President for Platforms And Applications,
       Microsoft Corporation [Reference at: http://www.kernel.org/~hpa/ms.html]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/