From owner-freebsd-questions@FreeBSD.ORG Thu Dec 10 19:32:45 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C353C1065696 for ; Thu, 10 Dec 2009 19:32:45 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from proxy1.bredband.net (proxy1.bredband.net [195.54.101.71]) by mx1.freebsd.org (Postfix) with ESMTP id 37E048FC26 for ; Thu, 10 Dec 2009 19:32:45 +0000 (UTC) Received: from ipb2.telenor.se (195.54.127.165) by proxy1.bredband.net (7.3.140.3) id 4AD3E1C0019D4B3A for freebsd-questions@freebsd.org; Thu, 10 Dec 2009 20:32:43 +0100 X-SMTPAUTH-B2: X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvFaAELbIEtV4js3PGdsb2JhbACBS4JQlFGCUQEBAQE3rAeQFoEvgipSBIFjgTU X-IronPort-AV: E=Sophos;i="4.47,376,1257116400"; d="scan'208";a="14044524" Received: from c-373be255.107-1-64736c10.cust.bredbandsbolaget.se (HELO gatekeeper.pp.dyndns.biz) ([85.226.59.55]) by ipb2.telenor.se with ESMTP; 10 Dec 2009 20:32:43 +0100 Received: from [192.168.69.67] (phobos [192.168.69.67]) by gatekeeper.pp.dyndns.biz (8.14.3/8.14.3) with ESMTP id nBAJWgSR025650 for ; Thu, 10 Dec 2009 20:32:42 +0100 (CET) (envelope-from freebsd-questions@pp.dyndns.biz) Message-ID: <4B214CD9.2010706@pp.dyndns.biz> Date: Thu, 10 Dec 2009 20:32:41 +0100 From: =?UTF-8?B?TW9yZ2FuIFdlc3N0csO2bQ==?= User-Agent: Thunderbird 2.0.0.23 (X11/20091010) MIME-Version: 1.0 To: FreeBSD Questions References: <27ade5280912040912i53f9871cj9502afc941073bef@mail.gmail.com> In-Reply-To: <27ade5280912040912i53f9871cj9502afc941073bef@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: SMP and ALTQ_NOPCC X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 19:32:45 -0000 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