public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] kernel.pid_max
@ 2006-09-17  6:53 darren kirby
  2006-09-17 15:48 ` Richard Fish
  2006-09-17 16:49 ` Drew
  0 siblings, 2 replies; 3+ messages in thread
From: darren kirby @ 2006-09-17  6:53 UTC (permalink / raw
  To: gentoo-user

Hello,

>From /etc/sysctl.conf:

# Allow for more PIDs (cool factor!); may break some programs
#kernel.pid_max = 999999

I though it may be neat to have a bigger pid pool, So I edited the file to 
change the value to 99999 and run:

#  sysctl -p
error: "Invalid argument" setting key "kernel.pid_max"
# cat /proc/sys/kernel/pid_max
32768
# echo "99999" > /proc/sys/kernel/pid_max
bash: echo: write error: Invalid argument
# echo 99999 > /proc/sys/kernel/pid_max
bash: echo: write error: Invalid argument
# sysctl -w kernel.pid_max="99999"
error: "Invalid argument" setting key "kernel.pid_max"
# sysctl -w kernel.pid_max=99999
error: "Invalid argument" setting key "kernel.pid_max"

How do you get this to work? I do have sysctl support in the kernel:

# cat /usr/src/linux/.config | grep SYSCTL
CONFIG_SYSCTL=y

Also, assuming you can help me get this sorted does anyone know which programs 
this may break?

Thanks for consideration,
-d
-- 
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] kernel.pid_max
  2006-09-17  6:53 [gentoo-user] kernel.pid_max darren kirby
@ 2006-09-17 15:48 ` Richard Fish
  2006-09-17 16:49 ` Drew
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fish @ 2006-09-17 15:48 UTC (permalink / raw
  To: gentoo-user

On 9/16/06, darren kirby <bulliver@badcomputer.org> wrote:
> #  sysctl -p
> error: "Invalid argument" setting key "kernel.pid_max"

You can find the answer in /usr/include/linux/threads.h.
PID_MAX_DEFAULT is defined as 0x8000 (32768) for most systems, and
PID_MAX_LIMIT is set to 4194304 *if* longs are larger than 4 bytes, or
PID_MAX_DEFAULT otherwise.

So if you are on a 32-bit system, you cannot set pid_max any larger
than PID_MAX_DEFAULT.

As far as "cool" factor goes, I don't see any coolness there.  All
that really happens when setting this is that the kernel uses more
memory for the process table, and it takes longer for the process IDs
to wrap.  But unless you really need to run more than 32k processes at
the same time, all you are really doing is wasting memory by
increasing this.

> Also, assuming you can help me get this sorted does anyone know which programs
> this may break?

Well anything compiled assuming pid_t was an unsigned 16-bit integer
value would probably crash.  This is probably unlikely....pid_t is
defined as an int, or a signed 32-bit value on any platform that
matters today.  But if you've got some ancient programs hanging around
or that you brought over from another system, they could have a
problem.

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] kernel.pid_max
  2006-09-17  6:53 [gentoo-user] kernel.pid_max darren kirby
  2006-09-17 15:48 ` Richard Fish
@ 2006-09-17 16:49 ` Drew
  1 sibling, 0 replies; 3+ messages in thread
From: Drew @ 2006-09-17 16:49 UTC (permalink / raw
  To: gentoo-user

Hi Darren,

You may be getting an invalid argument because on the i386 (Intel
32bit) architecture pid_max seems limited to 32768. I'm no kernel
expert but between this thread: http://lkml.org/lkml/2006/2/7/188 some
googling and reading through the source in:
/usr/src/linux/include/linux/threads.h (then manually branching
through the code), I came to the conclusion that 32768 is the maximum
permitted.

Hopefully a kernel guru is watching and can confirm or deny my
conclusions. I'm using a hardened kernel if that makes any difference.
;-)


-Drew
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-17 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-17  6:53 [gentoo-user] kernel.pid_max darren kirby
2006-09-17 15:48 ` Richard Fish
2006-09-17 16:49 ` Drew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox