From owner-freebsd-current@FreeBSD.ORG Fri Jun 24 22:41:34 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 D18F316A41C; Fri, 24 Jun 2005 22:41:34 +0000 (GMT) (envelope-from schweikh@schweikhardt.net) Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F0D443D49; Fri, 24 Jun 2005 22:41:33 +0000 (GMT) (envelope-from schweikh@schweikhardt.net) Received: by bremen.shuttle.de (Postfix, from userid 10) id 3C2FE3B96B; Sat, 25 Jun 2005 00:41:32 +0200 (CEST) Received: from hal9000.schweikhardt.net (localhost [127.0.0.1]) by hal9000.schweikhardt.net (8.13.3/8.13.3) with ESMTP id j5OMf7lU001115; Sat, 25 Jun 2005 00:41:07 +0200 (CEST) (envelope-from schweikh@hal9000.schweikhardt.net) Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.13.3/8.13.3/Submit) id j5OMf7cF001114; Sat, 25 Jun 2005 00:41:07 +0200 (CEST) (envelope-from schweikh) Date: Sat, 25 Jun 2005 00:41:07 +0200 From: Jens Schweikhardt To: John Baldwin Message-ID: <20050624224107.GA778@schweikhardt.net> References: <20050516113420.GA786@schweikhardt.net> <20050624165002.GA860@schweikhardt.net> <200506241353.52383.jhb@FreeBSD.org> <200506241528.44124.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506241528.44124.jhb@FreeBSD.org> User-Agent: Mutt/1.5.9i 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: Fri, 24 Jun 2005 22:41:35 -0000 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, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped)