¿Cómo cambiar el número PID máximo del kernel?

¿Cómo cambiar el número PID máximo del kernel?

El número máximo de PID predeterminado es 32768. Para obtener esta información, escriba:

cat /proc/sys/kernel/pid_max 
32768

o

sysctl kernel.pid_max
kernel.pid_max = 32768

Ahora quiero cambiar este número... pero no puedo. Bueno, en realidad puedo cambiarlo a un valor menor o igual. Por ejemplo:

linux-6eea:~ # sysctl -w  kernel.pid_max=32768
kernel.pid_max = 32768

Pero no puedo hacerlo por un valor mayor que 32768. Por ejemplo:

linux-6eea:~ # sysctl -w  kernel.pid_max=32769
error: "Invalid argument" setting key "kernel.pid_max"

Algunas ideas ?

PD: Mi kernel es Linux linux-6eea 3.0.101-0.35-pae #1 SMP Miércoles 9 de julio 11:43:04 UTC 2014 (c36987d) i686 i686 i386 GNU/Linux

Respuesta1

El valor sólo se puede ampliar hasta un máximo teórico de 32768 para sistemas de 32 bits o 4194304 para 64 bits.

De man 5 proc:

/proc/sys/kernel/pid_max  
  This file (new in Linux 2.5) specifies the value at which PIDs wrap around
  (i.e., the value in this file is one greater than the maximum PID). The
  default value for this file, 32768, results in the same range of PIDs as
  on earlier kernels. On 32-bit platfroms, 32768 is the maximum value for
  pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22
  (PID_MAX_LIMIT, approximately 4 million).

información relacionada