From owner-cvs-all@FreeBSD.ORG Sat Apr 16 14:57:39 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F27F16A4CE; Sat, 16 Apr 2005 14:57:39 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2C8D43D31; Sat, 16 Apr 2005 14:57:38 +0000 (GMT) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j3GEvcE4073183; Sat, 16 Apr 2005 14:57:38 GMT (envelope-from marius@repoman.freebsd.org) Received: (from marius@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j3GEvcI3073182; Sat, 16 Apr 2005 14:57:38 GMT (envelope-from marius) Message-Id: <200504161457.j3GEvcI3073182@repoman.freebsd.org> From: Marius Strobl Date: Sat, 16 Apr 2005 14:57:38 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/sparc64/include cpufunc.h pcpu.h tick.h src/sys/sparc64/sparc64 mp_machdep.c tick.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2005 14:57:39 -0000 marius 2005-04-16 14:57:38 UTC FreeBSD src repository Modified files: sys/sparc64/include cpufunc.h pcpu.h tick.h sys/sparc64/sparc64 mp_machdep.c tick.c Log: - Add a workaround for a bug in BlackBird CPUs (said to be part of the SpitFire erratum #54) which can cause writes to the TICK_CMPR register to fail. This seems to fix the dying clocks problem reported by jhb@ and kris@. [1] - In tick_start() don't reset the tick counter of the boot processor to zero. It's initially reset in _start() and afterwards but _before_ tick_start() is called on the BSP the APs synchronise with the tick counter of the BSP in mp_startup(). Resetting the tick counter of the BSP in tick_start() probably also was the cause of problems seen when using the CPU tick counter as timecounter on SMP machines. Not resetting the tick counter of the BSP in mp_startup() makes the tick counters and tick interrupts between the BSP and APs be pretty much in sync as it's supposed to be. This also means there's no longer a real reason to have separate tick_start() and tick_start_ap() so merge them and zap tick_start_ap(). This is also a first step in simplifying the interface to the tick counters in preparation to use alternate clock hardware where available. - Switch to the algorithm used on FreeBSD/ia64 for updating the tick interrupt register and which compensates the clock drift caused by varying delays between when the tick interrupts actually trigger and when they are serviced. Not compensating the clock drift mainly hurts interactive performance especially when using WITNESS. [2] For further information about the algorithm also see the commit log of sys/ia64/ia64/interrupt.c rev. 1.38. On sparc64 the sysctls for monitoring the behaviour of the tick interrupts are machdep.tick.adjust_edges, machdep.tick.adjust_excess, machdep.tick.adjust_missed and machdep.tick.adjust_ticks. - In tick_init() just use tick_stop() for stopping the tick interrupts until a proper handler is set up later. This also stops the system tick interrupt on USIII systems earlier. - In tick_start() check for a rough upper limit of HZ. - Some minor changes, e.g. use FBSDID, remove unused headers, etc. Info obtained from: Linux [1] Ok'ed by: marcel [2] Additional testing by: kris (earlier version of the workaround), jhb X-MFC after: 3 days [1] Revision Changes Path 1.20 +17 -0 src/sys/sparc64/include/cpufunc.h 1.20 +2 -0 src/sys/sparc64/include/pcpu.h 1.4 +1 -8 src/sys/sparc64/include/tick.h 1.29 +4 -3 src/sys/sparc64/sparc64/mp_machdep.c 1.16 +92 -54 src/sys/sparc64/sparc64/tick.c