From owner-freebsd-current@FreeBSD.ORG Mon Jun 27 19:35:47 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3632316A422; Mon, 27 Jun 2005 19:35:47 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 931EA43D1F; Mon, 27 Jun 2005 19:35:46 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.41.231] (Not Verified[65.202.103.25]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Mon, 27 Jun 2005 15:49:19 -0400 From: John Baldwin To: Jens Schweikhardt Date: Mon, 27 Jun 2005 15:29:21 -0400 User-Agent: KMail/1.8 References: <20050516113420.GA786@schweikhardt.net> <200506241528.44124.jhb@FreeBSD.org> <20050624224107.GA778@schweikhardt.net> In-Reply-To: <20050624224107.GA778@schweikhardt.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506271529.22790.jhb@FreeBSD.org> Cc: freebsd-current@FreeBSD.org, phk@FreeBSD.org Subject: Re: Timekeeping hosed by factor 3, high lapic[01] interrupt rates X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2005 19:35:47 -0000 On Friday 24 June 2005 06:41 pm, Jens Schweikhardt wrote: > John et al, > > On Fri, Jun 24, 2005 at 03:28:42PM -0400, John Baldwin wrote: > # On Friday 24 June 2005 01:53 pm, John Baldwin wrote: > # > On Friday 24 June 2005 12:50 pm, Jens Schweikhardt wrote: > # > > On Thu, Jun 23, 2005 at 05:14:39PM -0400, John Baldwin wrote: > # > > ... > # > > # Ok. What timecounter does your UP kernel use, and does your UP > kernel # > > break # if you change the timecounter to i8254? > # > > > # > > The UP uses the TSC: > # > > $ sysctl -a|grep timec > # > > kern.timecounter.stepwarnings: 0 > # > > kern.timecounter.nbinuptime: 136311 > # > > kern.timecounter.nnanouptime: 0 > # > > kern.timecounter.nmicrouptime: 664 > # > > kern.timecounter.nbintime: 1273 > # > > kern.timecounter.nnanotime: 36 > # > > kern.timecounter.nmicrotime: 1237 > # > > kern.timecounter.ngetbinuptime: 405 > # > > kern.timecounter.ngetnanouptime: 29 > # > > kern.timecounter.ngetmicrouptime: 2534 > # > > kern.timecounter.ngetbintime: 0 > # > > kern.timecounter.ngetnanotime: 0 > # > > kern.timecounter.ngetmicrotime: 5 > # > > kern.timecounter.nsetclock: 2 > # > > kern.timecounter.hardware: TSC > # > > kern.timecounter.choice: TSC(800) i8254(0) dummy(-1000000) > # > > kern.timecounter.tick: 1 > # > > kern.timecounter.smp_tsc: 0 > # > > > # > > When I do > # > > > # > > $ sysctl kern.timecounter.hardware=i8254 > # > > > # > > on the UP the time dilation by factor 3 starts and the lapic rate > # > > increases. So yes, that breaks the UP kernel. > # > > # > Ok. Can you try this untested patch? It's mostly from phk and I > haven't # > yet tested it locally to make sure it doesn't break things: > # > # Scratch that. > > (This patch made time advance with 11-fold speed, lapic rates about 170... > interesting effects happen then ;-) > > # I've reproduced this locally now on a testbox I have and had to > # add a bugfix from phk to get it to work. Here's the patch that works for > me: > > Sorry, does not work here; still time dilation in sleep 1 (MP case, no > sysctl kern.timecounter.hardware frobs): > > $ vmstat -i > interrupt total rate > irq1: atkbd0 455 9 > irq13: npx0 1 0 > irq14: ata0 63 1 > irq15: ata1 109 2 > irq18: em0 15 0 > irq24: ahd0 4529 96 > irq25: ahc0 16 0 > lapic0: timer 272712 5802 > lapic1: timer 258021 5489 > Total 535921 11402 > > Regards, Forget SMP and go back to UP for now. Turn off ntpd if you are using it, then do something like this: # ntpdate ntp.xxxx ; sleep 10 ; ntpdate ntp.xxxx And try it both with the timecounter set to TSC and with the timecounter set to i8254. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org