From owner-freebsd-questions@FreeBSD.ORG Thu Nov 11 15:47:02 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9754D16A4CE for ; Thu, 11 Nov 2004 15:47:02 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4391543D46 for ; Thu, 11 Nov 2004 15:47:02 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.1) id iABFl10A027050; Thu, 11 Nov 2004 09:47:01 -0600 (CST) (envelope-from dan) Date: Thu, 11 Nov 2004 09:47:01 -0600 From: Dan Nelson To: Malcolm Kay Message-ID: <20041111154700.GA4702@dan.emsphone.com> References: <200411111935.01396.malcolm.kay@internode.on.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200411111935.01396.malcolm.kay@internode.on.net> X-OS: FreeBSD 5.3-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-questions@freebsd.org Subject: Re: PID in linux emulation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2004 15:47:02 -0000 In the last episode (Nov 11), Malcolm Kay said: > I am attempting to run a commercial CAD software suite compiled for > Linux on a FreeBSD 4.10 OS. It runs as well or perhaps better than on > a Linux box until the PID becomes large. > > The MAX_PID for FreeBSD is 99999 while Linux has a limit of 0x8000. [...] > Can I edit in /usr/include/sys/proc.h and recompile the system > (kernel) for a lower MAX_PID? Will it work? Will it lead to other > complications? Is this where the kernel compilation obtains its > value? Sure. You have to lower PID_MAX when running FreeBSD 2.x or ancient IBCS code, too. There should be no ill effects. > Can MAX_PID be changed via sysctl? > > Is there someway to reset the current PID without rebooting? PID_MAX could be converted into a sysctl/boot-time tuneable without much trouble. The kernel uses values above PID_MAX for thread ids, so I don't think moving the ceiling at runtime is a good idea. Allowing it to be set to any value less than the boot-time limit should work fine, though. You also might want to ask your vendor to fix their hardcoded limit. There is no guarantee that the stock Linux kernel will use 16-bit pid values forever, and there is already a "pidhashing" patch that bumps it up to 4 million. -- Dan Nelson dnelson@allantgroup.com