From owner-freebsd-stable@FreeBSD.ORG Tue Sep 8 18:00:13 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 756DB1065695 for ; Tue, 8 Sep 2009 18:00:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 47D498FC1F for ; Tue, 8 Sep 2009 18:00:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D55CF46B39; Tue, 8 Sep 2009 14:00:12 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 241288A01B; Tue, 8 Sep 2009 14:00:12 -0400 (EDT) From: John Baldwin To: freebsd-stable@freebsd.org Date: Tue, 8 Sep 2009 13:08:23 -0400 User-Agent: KMail/1.9.7 References: <20090906155154.GA8283@onelab2.iet.unipi.it> In-Reply-To: <20090906155154.GA8283@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909081308.23345.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 08 Sep 2009 14:00:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Luigi Rizzo Subject: Re: incorrect usleep/select delays with HZ > 2500 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2009 18:00:13 -0000 On Sunday 06 September 2009 11:51:54 am Luigi Rizzo wrote: > [Note 3] the TSC frequency is computed reading the tsc around a > call to DELAY(1000000) and assuming that the i8254 runs > at the nominal rate, 1.193182 MHz. > From tests I have made, the measurement in init_TSC() returns > a large error when HZ is large, whereas repeating the measurement > at a later time returns a much more reliable value. > As an example, see the following: > > Sep 6 14:21:59 lr kernel: TSC clock: at init_TSC 2323045616 Hz > Sep 6 14:21:59 lr kernel: Features=0x178bfbff > Sep 6 14:21:59 lr kernel: AMD Features=0xea500800 > Sep 6 14:21:59 lr kernel: TSC: P-state invariant > Sep 6 14:21:59 lr kernel: TSC clock: at cpu_startup_end 2323056910 Hz > Sep 6 14:21:59 lr kernel: TSC clock: at acpi_timer_probe 2311254060 Hz > Sep 6 14:21:59 lr kernel: TSC clock: at acpi_timer_probe_2 2311191310 Hz > Sep 6 14:21:59 lr kernel: TSC clock: at pn_probe_start 2300822648 Hz > Sep 6 14:21:59 lr kernel: TSC clock: at pn_attach_start 2300830946 Hz > Sep 6 14:21:59 lr kernel: TSC clock: at pn_probe_start 2300840133 Hz > Sep 6 14:21:59 lr kernel: TSC clock: at pn_attach_start 2300835253 Hz > Sep 6 14:21:59 lr kernel: TSC clock: at lapic_setup_clock 2300868376 Hz > > The latter values are close to what is reported when HZ=1000. Try disabling legacy USB support in the BIOS to see if an SMI# is firing during the DELAY() causing the TSC freq to be too high. I have seen the USB legacy support cause this in other machines. -- John Baldwin