On Tuesday 14 December 2010 03:07 pm, Jung-uk Kim wrote: > Author: jkim > Date: Tue Dec 14 20:07:51 2010 > New Revision: 216443 > URL: http://svn.freebsd.org/changeset/base/216443 > > Log: > Stop lying about supporting cpu_est_clockrate() when TSC is > invariant. This function always returned the nominal frequency > instead of current frequency because we use RDTSC instruction to > calculate difference in CPU ticks, which is supposedly constant for > the case. Now we support cpu_get_nominal_mhz() for the case, > instead. Note it should be just enough for most usage cases > because cpu_est_clockrate() is often times abused to find maximum > frequency of the processor.
Actually, I wanted to support cpu_est_clockrate() as well and the following was my naive attempt: http://people.freebsd.org/~jkim/tsc.diff Unfortunately, it only worked for AMD64 Family 0Fh and below where we don't need this hack at all. I tried everything I could (e.g., fooling around with branch prediction) but it constantly gave me better MHz for under-clocked cases. :-/ Jung-uk Kim _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "[email protected]"
