SMP and ALTQ_NOPCC

Morgan Wesström freebsd-questions at pp.dyndns.biz
Thu Dec 10 19:32:45 UTC 2009


APseudoUtopia wrote:
> Hello,
> 
> With the improvements in SMP in FreeBSD 8.0, is the ALTQ_NOPCC option
> still required? In the handbook and other older documentation, it says
> ALTQ_NOPCC is in fact required on SMP systems because the TSC is
> unstable. I was wondering if this is still the case after the
> improvements done with SMP.
> 
> Thanks.

Not every CPU has an unstable TSC. It mostly affects AMD processors and
Intel Pentium M. Wikipedia has a great listing of models and families
affected:
http://en.wikipedia.org/wiki/Time_Stamp_Counter#Implementation_in_Various_Processors

However, in /usr/src/sys/amd64/amd64/tsc.c you can find the following code:

#ifdef SMP
        /*
         * We can not use the TSC in SMP mode unless the TSCs on all CPUs
         * are somehow synchronized.  Some hardware configurations do
         * this, but we have no way of determining whether this is the
         * case, so we do not use the TSC in multi-processor systems
         * unless the user indicated (by setting kern.timecounter.smp_tsc
         * to 1) that he believes that his TSCs are synchronized.
         */
        if (mp_ncpus > 1 && !smp_tsc)
                tsc_timecounter.tc_quality = -100;
#endif

It will set the quality of the timestamp counter to -100 if SMP is
detected and effectively disable it so by default the TSC won't be used
on an SMP system and consequently you don't have to use ALTQ_NOPCC. It
is "probably" safe to enable and use TSC in pf, as described in the
code, if you have a modern Intel CPU but I have not tested it.

Regards
Morgan


More information about the freebsd-questions mailing list