pid number creation rules on aix

Hello,

On a AIX 5.3.5.0 server, we have PID exceeding 999999. This cause some troubles in our programms.

I would like to know the process creation rules on aix :

  • what is the maximum pid number ?
  • what is the wrap limit on aix, and where to find it, how to configure pid wrap limit ?
  • How pid are attributed ?
    -...

thank you.

The best explanation i have found is this:

This page seems also to be helpful.

Maybe some guys who have attended the "kernel internals" class could expand on that?

May i ask about the background of this question?

I hope this helps.

bakunin

I modified my question, see above. Thank you.

An AIX PID is composed of the process table slot number and a generation count. Depending on whether you use a 32-Bit or a 64-Bit kernel the format differs slightly. In a 32-Bit Kernel it is a 32-Bit number and a 64-Bit number in the 64-Bit Kernel. However in both cases only the first 26 Bits are being used actually. E.g.

Bit:     31 ... 26 | 25 .................................... 8 | 7 ..... 1 | 0
Usage:     000000  |          Process table slot index         | Gen.count | 0
  • Bit 0 is always zero, therefore every Process ID except for init is an even number.
  • The genereation count is used to prevent PID being used again to often. I.e. every process slot can be used 128 times before a formerly used PID is reused.
  • The process table slot index is the process table slot number.
  • The remaining bits are unused.
  • If you see a PID with an uneven number you found a Thread ID.

With a 64-Bit Kernel it works like this:

Bit:     63 ............. 26 | 25 ............... 12 | 11 ... 8 |  7 ..... 1 | 0
Usage:       000....000      | PTSI low order bits   |   SRAD   |  Gen.count | 0 

SRAD stands for Scheduler Resource Affinity Domain. Those bits are used to select the zone of the process table. The number of SRAD bits is version/release dependent. 5.1 uses 5 bits, 5.2 and 5.3 use 4 bits.