Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Nov 2004 09:47:01 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Malcolm Kay <malcolm.kay@internode.on.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: PID in linux emulation
Message-ID:  <20041111154700.GA4702@dan.emsphone.com>
In-Reply-To: <200411111935.01396.malcolm.kay@internode.on.net>
References:  <200411111935.01396.malcolm.kay@internode.on.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041111154700.GA4702>