machdep.tsc_freq and very fast CPUs
Bruce Cran
bruce at cran.org.uk
Wed Feb 25 10:13:01 PST 2004
Having heard about how Windows thought a P4 EE CPU was running at 10MHz, I
decided to do a bit of poking around the FreeBSD kernel to check that all
the frequencies were correctly expressed in 64-bit values. While I
quickly saw that they were all u_int64_t, I was a bit worried when I saw
a sizeof(u_int) in one place, even though it did seem to have a
qualifier saying it was a 64-bit integer. Shouldn't
machdep.tsc_freq be read-only, by changing line 147 of
sys/i386/i386/tsc.c to read CTLFLAG_RD instead of CTLFLAG_RW? I've
attached a log of what happened on my system when I changed the sysctl
value. I haven't done a lot of investigation into the kernel here so
I'm willing to accept that I may be completely wrong, but something
just doesn't seem quite right.
--
Bruce Cran
-------------- next part --------------
box1# sysctl machdep.tsc_freq
machdep.tsc_freq: 1401716358
box1# sysctl machdep.tsc_freq=4294967294
machdep.tsc_freq: 1401716358 -> 4294967294
box1# sysctl machdep.tsc_freq=4294967299
machdep.tsc_freq: 4294967294 -> 3
box1# sysctl machdep.tsc_freq=42949672500
machdep.tsc_freq: 3 -> 204
More information about the freebsd-hackers
mailing list