From owner-freebsd-current@FreeBSD.ORG Mon Apr 12 17:52:39 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 B6BE316A4CE; Mon, 12 Apr 2004 17:52:39 -0700 (PDT) Received: from ftp.bjpu.edu.cn (ftp.bjpu.edu.cn [202.112.78.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 041E443D1F; Mon, 12 Apr 2004 17:52:39 -0700 (PDT) (envelope-from delphij@frontfree.net) Received: from localhost (localhost [127.0.0.1]) by ftp.bjpu.edu.cn (Postfix) with ESMTP id 3F54D529E; Tue, 13 Apr 2004 08:52:37 +0800 (CST) Received: from ftp.bjpu.edu.cn ([127.0.0.1]) by localhost (ftp.bjpu.edu.cn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 92880-02; Tue, 13 Apr 2004 08:52:34 +0800 (CST) Received: from beastie.frontfree.net (beastie.frontfree.net [218.107.145.7]) by ftp.bjpu.edu.cn (Postfix) with ESMTP id D36AC529A; Tue, 13 Apr 2004 08:52:33 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 76ABE11791; Tue, 13 Apr 2004 08:52:33 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01418-07; Tue, 13 Apr 2004 08:52:32 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 43BF0116C2; Tue, 13 Apr 2004 08:52:32 +0800 (CST) Date: Tue, 13 Apr 2004 08:52:32 +0800 From: Xin LI To: Julian Elischer Message-ID: <20040413005232.GA2959@frontfree.net> References: <20040412233701.GA71177@cat.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.2-CURRENT FreeBSD 5.2-CURRENT #20: Mon Apr 12 22:54:39 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net X-Virus-Scanned: by amavisd-new at frontfree.net cc: FreeBSD current users cc: Tim Robbins Subject: Re: JKH project.. 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, 13 Apr 2004 00:52:39 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 12, 2004 at 04:50:18PM -0700, Julian Elischer wrote: > On Tue, 13 Apr 2004, Tim Robbins wrote: [...] > > On Sun, Apr 11, 2004 at 03:51:45PM -0700, Julian Elischer wrote: > >=20 > > > the fork syscall has to check the new PID against all exixting pids.. > > >=20 > > > here's the current code.. when teh PID-space starts becoming > > > "fragmented.." this starts to take "real time". > > [...] > > > with several thousand processes, forking a lot, this starts to take= =20 > > > a 'noticable' amount of time. > >=20 > > I've been using a hashtable-based PID allocator for the last few months. > > I didn't have enough time to run any serious benchmarks, so I never > > committed it. If the amount of time is noticeable in your environment, > > would you mind trying the patch below? > >=20 [...] >=20 > Well what you've done seems to fit my definition of "improved".. >=20 > anyone got comments? If memory serves me right, there's a benchmark done by David Schultz earlier this year, which is done to compare the NetBSD's PID Allocator ported by Jun Su[1,2] with Tim's hash based allocator[3] in p4. The benchmark report is available here: http://people.freebsd.org/~das/pbench/pbench.html [1] Jun Su's original patch http://www.arbornet.org/~junsu/pid.diff [2] Jun Su's patch I maintained locally to adopt latest -CURRENT changes http://research.delphij.net/freebsd/pid.diff [3] Tim's patch in p4 http://perforce.freebsd.org/chv.cgi?CH=3D43361 There were a discussion in current@ in February, for reference: My first post in January as a "Call for testers": http://lists.freebsd.org/pipermail/freebsd-current/2004-January/019940.html Jun Su's post about update of his patch: http://lists.freebsd.org/pipermail/freebsd-current/2004-February/020503.ht= ml David Schultz's post of his benchmark: http://lists.freebsd.org/pipermail/freebsd-current/2004-February/020807.ht= ml John's opinion: http://lists.freebsd.org/pipermail/freebsd-current/2004-February/020957.ht= ml There're many other discussions during this, which is valuable to read. I personally prefered junsu's version as the side effect of the patch makes pids smaller, however, I'd concur the concerns about simplicity of code will be a good reason of the final decision. Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --/04w6evG8XlLl3ft Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAeznQOfuToMruuMARAo6zAJ9+5IzDUqjTaiaW67Vow3EDnzRuCgCfZPZ2 CuWQLrFW/dJpVJ4E3nhnLhI= =m6An -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft--