From owner-freebsd-current@FreeBSD.ORG Fri Nov 28 21:11:45 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 C0F4716A4CE; Fri, 28 Nov 2003 21:11:45 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6620E43FA3; Fri, 28 Nov 2003 21:11:44 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 895605308; Sat, 29 Nov 2003 06:11:43 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 3DC6C530A; Sat, 29 Nov 2003 06:11:36 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 2811433C6A; Sat, 29 Nov 2003 06:11:36 +0100 (CET) To: Tim Robbins References: <20031127070239.GA12950@wombat.robbins.dropbear.id.au> <20031129011658.GA1347@wombat.robbins.dropbear.id.au> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Sat, 29 Nov 2003 06:11:36 +0100 In-Reply-To: (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav's?= message of "Sat, 29 Nov 2003 03:17:08 +0100") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.6 required=5.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_SORBS autolearn=no version=2.60 cc: current@freebsd.org Subject: Re: Port of Niels Provos's file descriptor allocation code 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: Sat, 29 Nov 2003 05:11:45 -0000 I've run some benchmarks of my own with and without the patch, and it's a definite improvement... I expected it to go linear for large number of open file descriptors, and it does, but the slope is much less steep than I expected, which explains why it looked like O(1). I have two objections to the patch, however: the first is the use of NDENTRYSHIFT to obfuscate multiplications and divisions by NDENTRIES (which is a constant, so the compiler will optimize it anyway). The second is the use of uint32_t instead of unsigned long which should be more efficient on 64-bit machines (NDENTRIES would have to be made dependent on sizeof(unsigned long)) and it scares me a bit that the Banga & Mogul paper has been floating around for five years and nobody took any notice... DES --=20 Dag-Erling Sm=F8rgrav - des@des.no