From owner-freebsd-current@FreeBSD.ORG Fri May 7 07:39:24 2004 Return-Path: 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 7DA4716A4CE; Fri, 7 May 2004 07:39:24 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2BA043D41; Fri, 7 May 2004 07:39:23 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i47Ed9t1013802; Fri, 7 May 2004 10:39:09 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i47Ed9p7013799; Fri, 7 May 2004 10:39:09 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Fri, 7 May 2004 10:39:09 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Brad Knowles In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@FreeBSD.org cc: John Baldwin Subject: Re: 4.7 vs 5.2.1 SMP/UP bridging performance X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 07 May 2004 14:39:24 -0000 On Fri, 7 May 2004, Brad Knowles wrote: > At 10:55 PM -0400 2004/05/06, Robert Watson wrote: > > > On occasion, I've had conversations with Peter Wemm about providing HAL > > modules with optimized versions of various common routines for specific > > hardware platforms. However, that would require us to make a trade-off > > between the performance benefits of inlining and the performance benefits > > of a HAL module... > > I'm confused. Couldn't you just do this sort of stuff as > conditional macros, which would have both benefits? Well, the goal of introducing HAL modules would be that you don't have to recompile the kernel in order to perform local hardware-specific optimization of low level routines. I.e., you could substitute faster implementations of zeroing, synchronization, certain math routines, etc based on the CPU discovered at run-time. While you can have switch statements, etc, it's faster just to relink the kernel to use the better implementation for the available CPU. However, if you do that, you still end up with the function call cost, which might well out-weight the benefits of specialization. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research