From owner-freebsd-arch@FreeBSD.ORG Mon Aug 22 13:32:33 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CACC816A41F; Mon, 22 Aug 2005 13:32:33 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AFFE43D48; Mon, 22 Aug 2005 13:32:33 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 2D93F61C3; Mon, 22 Aug 2005 15:32:11 +0200 (CEST) Received: from xps.des.no (des.no [80.203.228.37]) by tim.des.no (Postfix) with ESMTP id 1974561C1; Mon, 22 Aug 2005 15:32:11 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 66F1533D44; Mon, 22 Aug 2005 15:32:22 +0200 (CEST) To: Alexey Dokuchaev References: <20050822100059.GA24626@FreeBSD.org> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Mon, 22 Aug 2005 15:32:22 +0200 In-Reply-To: <20050822100059.GA24626@FreeBSD.org> (Alexey Dokuchaev's message of "Mon, 22 Aug 2005 10:00:59 +0000") Message-ID: <863bp25c7t.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Tests: ALL_TRUSTED,AWL,BAYES_00 X-Spam-Learn: ham X-Spam-Score: -5.2/3.0 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on tim.des.no Cc: arch@freebsd.org Subject: Re: fdesc allocation optimization X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2005 13:32:33 -0000 Alexey Dokuchaev writes: > i've been browsing some of dfbsd resources recently, and found this one > being pretty interesting: > > http://leaf.dragonflybsd.org/mailarchive/commits/2005-06/msg00526.html > > however, it seemingly did not get attention in our lists. so i am > wondering if there are work/plans on porting hsu@'s work? i remember > that at some point we adopted some openbsd-derived algorithm, but since > matt states that this is "far better algorithm then anything we or > freebsd thought up before", i figured it worth a look. Bollocks. Our current algorithm (which I wrote) is so fast you don't even notice it's there. It's actually simpler than the OpenBSD code from which it was inspired, and in theory it should be slower, but I discovered that the overhead of the "better" algorithm was so high that it consistently lost to the simpler one for reasonable amounts of file descriptors (up to about 100,000 per process). The source code for the microbenchmark I used, and selected graphs comparing my code to the previous implementation, are available at . (the strange artifacts you see on the red graphs are the result of the file descriptor table overrunning the CPU cache) DES --=20 Dag-Erling Sm=F8rgrav - des@des.no