From owner-freebsd-bugs@FreeBSD.ORG Wed Jun 4 13:50:14 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35A8B37B404 for ; Wed, 4 Jun 2003 13:50:14 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A19F543F93 for ; Wed, 4 Jun 2003 13:50:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h54KoDUp036875 for ; Wed, 4 Jun 2003 13:50:13 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h54KoDTQ036874; Wed, 4 Jun 2003 13:50:13 -0700 (PDT) Date: Wed, 4 Jun 2003 13:50:13 -0700 (PDT) Message-Id: <200306042050.h54KoDTQ036874@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Evans Subject: Re: misc/34596: slow gettimeofday in FreeBSD 4.5 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bruce Evans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 20:50:14 -0000 The following reply was made to PR misc/34596; it has been noted by GNATS. From: Bruce Evans To: Andreas Gustafsson Cc: freebsd-gnats-submit@freebsd.org Subject: Re: misc/34596: slow gettimeofday in FreeBSD 4.5 Date: Thu, 5 Jun 2003 06:43:01 +1000 (EST) On Wed, 4 Jun 2003, Andreas Gustafsson wrote: > Bruce Evans writes: > > FreeBSD-4.8 should be configured to use the TSC timecounter in the non-SMP > > case. > > Do you mean "should be automatically configured", or "should be > configured by the user"? If the latter, where is this documented? Both :-). It seems to be undocumented (except in the source code). > > Configuration of apm may pessimize the default configuration. The > > TSC is not supported for the !SMP case. > > When you say "!SMP", do you mean "non-SMP" (which would seem to > contradict the above) or "SMP"? I mean "non-SMP". The automatic configuration does a reasonable job in the non-SMP case unless apm is configured. Unfortunately, GENERIC in RELENG_4 sets a bad example by configuring apm. It is configured as disabled so it is usually not used, but this doesn't help because the automatic configuration uses a compile-time test for apm. Better yet, the automatic configuration refuses to register the TSC as a timecounter if apm is statically configured, so you can't select the TSC timecounter at runtime using "sysctl kern.timecounter=TSC" unless you remove apm from the configuration. These bugs are fixed in -current. In the SMP case, the TSC timecounter is similarly statically not configured, but this is correct since it doesn't work in the SMP case. The automatic configuration uses the best available timecounter, but this is too often the i8254 timecounter since there aren't many working timecounters to choose from. In -current, there is also the acpi timecounter which works right in more cases (broken cases include ones where acpi is broken and some old machines where the acpi timer runs at double speed). Bruce