Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Dec 2009 20:32:41 +0100
From:      =?UTF-8?B?TW9yZ2FuIFdlc3N0csO2bQ==?= <freebsd-questions@pp.dyndns.biz>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: SMP and ALTQ_NOPCC
Message-ID:  <4B214CD9.2010706@pp.dyndns.biz>
In-Reply-To: <27ade5280912040912i53f9871cj9502afc941073bef@mail.gmail.com>
References:  <27ade5280912040912i53f9871cj9502afc941073bef@mail.gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4B214CD9.2010706>