From owner-freebsd-hackers Wed Jan 2 12:50:27 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from hawk.prod.itd.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by hub.freebsd.org (Postfix) with ESMTP id 381AF37B41D for ; Wed, 2 Jan 2002 12:49:47 -0800 (PST) Received: from pool0051.cvx40-bradley.dialup.earthlink.net ([216.244.42.51] helo=mindspring.com) by hawk.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16LsKN-00040e-00; Wed, 02 Jan 2002 12:49:35 -0800 Message-ID: <3C337261.6BB5BFE0@mindspring.com> Date: Wed, 02 Jan 2002 12:49:37 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: mitko@rila.bg Cc: hackers@freebsd.org Subject: Re: Magic number 100 in /sys/kern/kern_fork.c References: <20020102134345.2a00458f.mitko@rila.bg> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dimitar Peikov wrote: > > I've review /sys/kern/kern_fork.c file and have a question why the room of > 100 process numbers is hardcoded in the source? I think that if such room > is needed, it must be defined somewhere in headers, isn't it. > > Can someone explain me more the idea about that room? It's a setaside for system processes ("kprocs") at system start; think of it like the 1024 priviledged port reserve. I think the idea is to not have a random PID collide with a system process that was started at init time. If you start a heck of a lot of processes/kprocs, you will occasionally get collisions, but by not excluding where you *know* there are processes from the space, you are pretty much asking for a (very small) slowdown. The code is pretty straight forward, though a manifest constant mich be moreso; I don't know how permitting it to be changed would be of benefit. I could see how someone without scruples could "hide" processes, if it were runtime adjustable... -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message