Re: problem with running out of processes

Brian Gerst (bgerst@quark.vpplus.com)
Tue, 23 Feb 1999 15:00:46 -0500


Alex Buell wrote:
> #define NR_TASKS 512 /* On x86 Max 4092, or 4090 w/APM
> configured. */
>
> #define MAX_TASKS_PER_USER (NR_TASKS/2)
> #define MIN_TASKS_LEFT_FOR_ROOT 4
>
> OK, why is it only 512 instead of 4092? No wonder I ran out of processes
> so quickly. *sigh* Another re-compile awaits me.

Each process takes up 8k of non-swappable kernel memory for the kernel
stack and process structure. This is allocated dynamically (which can
cause problems if memory is fragmented, becuase the 8k needs to be
contiguous). If all 4092 processes are running this is almost 32Mb.
Double trouble for low-memory machines.

The reason the hard limit is at 4092 or 4090 is each process needs 2
entries in the GDT (Global Descriptor Table): a TSS (Task State Segment)
and an LDT (Local Descriptor Table). The way LDT descriptors are shared
now, one LDT per process is unnecessary, and should be changed to leave
more room for TSS descriptors. There are also 8 descriptors used by the
kernel, 10 if APM is enabled).

-- 

Brian Gerst

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/