Welcome to the Linux Foundation Forum!

Why kernel.pid_max = 4194304 on my system?

"For historical reasons, the largest PID has been limited to a 16-bit number, or 32768. But for some reason on my system the kernel.pid_max = 4194304 . How that possible.

Answers

  • coop
    coop Posts: 916

    Because you are on a 64 bit system :) and using a more recent kernel. The sentence could use more elatboration.

    r9:/home/coop>ps 
        PID TTY          TIME CMD
      54249 pts/2    00:00:00 bash
      80648 pts/2    00:00:00 ps
    r9:/home/coop>cat /proc/sys/kernel/pid_max 
    4194304
    r9:/home/coop>
    

    Note that 4194304=4*1024*1024, or 2^24 I don't know the historical specifics that made it this many bits.

  • Thanks for answering.

  • cocobongo
    cocobongo Posts: 12

    I'm currently running on OpenSUSE Tumbleweed with kernel 6.3.7-1-default (as per uname -a) on a 64-bit machine, but I still see the specified 32768 max_pid. Is the bit architecture relevant to this or perhaps the distribution maintainers are responsible for keeping this variable at a lower value?

  • coop
    coop Posts: 916

    Probably a distro thing, or the way they configure their kernel

  • cocobongo
    cocobongo Posts: 12

    Thank you for clarifying that!

Categories

Upcoming Training