From owner-freebsd-sparc64@FreeBSD.ORG Fri Jul 16 21:35:05 2010 Return-Path: Delivered-To: freebsd-sparc64@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED491065670; Fri, 16 Jul 2010 21:35:05 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id ACF8D8FC08; Fri, 16 Jul 2010 21:35:04 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id o6GLZ3Gq093383; Fri, 16 Jul 2010 23:35:03 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id o6GLZ3hO093382; Fri, 16 Jul 2010 23:35:03 +0200 (CEST) (envelope-from marius) Date: Fri, 16 Jul 2010 23:35:03 +0200 From: Marius Strobl To: Alexander Motin Message-ID: <20100716213503.GT4706@alchemy.franken.de> References: <4C404018.6040405@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C404018.6040405@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-sparc64@FreeBSD.org Subject: Re: [RFC] Event timers on sparc64/sun4v X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2010 21:35:05 -0000 On Fri, Jul 16, 2010 at 02:18:48PM +0300, Alexander Motin wrote: > Hi. > > I've made a patch, updating sparc64/sun4v timer driver to utilize new MI > event timer infrastructure. There are several benefits: > - unified interfaces and behavior with other platforms, > - support for timer in one-shot mode, > - more timer hardware can be easily supported (if there any). > Code works for me on UP sparc64 (SunBlade 100) and builds on sun4v. > Should work on SMP, but I can't test it. > > Patch for HEAD can be found here: > http://people.freebsd.org/~mav/timers_sparc.patch > > Any comments? > Hi, please don't commit this as-is: - using the stick instead of the tick counter for machines with CPUs and thus tick counters running at different speeds has turned out to be suboptimal, probably due to the fact that the 12.5MHz the stick counters typically are driven by don't provide sufficient granularity. Thus the more desireable variant for these machines probably is to provide the tick counter of the BSP as the only non-per-CPU timer and forward it to the APs via IPIs. This also leaves the stick counter of all >= US-III machines generally available for driving statclock, which likely is also desirable. - I'd like to keep the tick grace check as this caused problems in the past. Probably tick_et_start() just should return an error in this case. - I don't like wasting CPU cycles for determining whether the workaround for BlackBird CPUs is needed (assuming #1 above is implemented so distinguishing stick/tick is no longer needed) with every (s)tick interrupt which are a lot as this just won't ever change during runtime, i.e. I'd like to keep the different interrupt handlers which are set up as needed. - Replacing intr_disable_all() with intr_disable() on sun4v probably isn't a good idea as the latter doesn't disable IPIs as it does on sparc64 and other architectures. Marius