From owner-freebsd-current@FreeBSD.ORG Tue Jun 3 13:50:50 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 3C5C737B401; Tue, 3 Jun 2003 13:50:50 -0700 (PDT) Received: from mx0.freebsd-services.com (survey.codeburst.net [195.149.39.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F39A43F75; Tue, 3 Jun 2003 13:50:47 -0700 (PDT) (envelope-from paul@freebsd-services.com) Received: from [192.168.7.2] (freebsd.gotadsl.co.uk [81.6.249.198]) by mx0.freebsd-services.com (Postfix) with ESMTP id 070AA1B212; Tue, 3 Jun 2003 21:50:46 +0100 (BST) From: Paul Richards To: "M. Warner Losh" In-Reply-To: <1054584260.85972.26.camel@cf.freebsd-services.com> References: <20030603134717.GD35187@survey.codeburst.net> <20030603.085659.13314075.imp@bsdimp.com> <20030603155157.GH35187@survey.codeburst.net> <20030603.111956.46316212.imp@bsdimp.com> <1054584260.85972.26.camel@cf.freebsd-services.com> Content-Type: text/plain Organization: Message-Id: <1054586934.1388.4.camel@cf.freebsd-services.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 02 Jun 2003 21:48:55 +0100 Content-Transfer-Encoding: 7bit cc: doug@freebsd.org cc: current@freebsd.org 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 20:50:50 -0000 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? -- Tis a wise thing to know what is wanted, wiser still to know when it has been achieved and wisest of all to know when it is unachievable for then striving is folly. [Magician]