From owner-freebsd-current@FreeBSD.ORG Tue Jun 3 14:33:25 2003 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 5C31237B401 for ; Tue, 3 Jun 2003 14:33:25 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4ECD443FBF for ; Tue, 3 Jun 2003 14:33:24 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 1285 invoked from network); 3 Jun 2003 21:33:23 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 3 Jun 2003 21:33:23 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h53LXDp0004751; Tue, 3 Jun 2003 17:33:14 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <1054586934.1388.4.camel@cf.freebsd-services.com> Date: Tue, 03 Jun 2003 17:33:00 -0400 (EDT) From: John Baldwin To: Paul Richards cc: dfr@freebsd.org cc: current@freebsd.org cc: "M. Warner Losh" Subject: Re: VFS: C99 sparse format for struct vfsops 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: Tue, 03 Jun 2003 21:33:25 -0000 On 02-Jun-2003 Paul Richards wrote: > On Mon, 2003-06-02 at 21:04, Paul Richards wrote: > >> >> The tradeoff with using an index into an array is that there'd be a >> heavy penalty for growing the array if an extra method didn't fit, but >> that would be exceptionally rare and with our present usage we'd never >> have that happen. > > I'm not sure this is actually a problem after all since the Interface > doesn't change and therefore we know a-priori how many methods there can > be so we can pre-allocate an array. I wonder why Doug didn't do this, > perhaps he thought that there'd be very large interfaces and 255 was a > reasonable compromise for a cache. However, in practice we'd save a lot > of space per kobj by preallocating the actual number of entries we > needed for the Interface instead and then we could do away with the _ce > problem. This would actually speed up the dispatch a lot too since we > wouldn't have to traverse a list looking for a matching method entry and > could call the function directly from the method table. > > Doug, am I missing something? Well, it's dfr@ rather than doug@ :) (dfr@ cc'd) -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/