Date: Wed, 25 Feb 2004 18:12:25 +0000 From: Bruce Cran <bruce@cran.org.uk> To: freebsd-hackers@freebsd.org Subject: machdep.tsc_freq and very fast CPUs Message-ID: <20040225181225.GA597@box1.cran>
next in thread | raw e-mail | index | archive | help
--LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tsc.log" 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 --LZvS9be/3tNcYl/X--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040225181225.GA597>