system hang with "__alloc_page: 1-order allocation failed"
Subsystems (4)
Quoted 4 lines
Maybe it would be good to lower the default threads-max to about 10% or less of physical memory ?
And MIN_THREADS_FOR_ROOT should be reintroduced: the define is still there, but the actual code is missing.
I've attached an older patch that:
* reintroduces MIN_THREADS_FOR_ROOT (or remove the define)
* adds lower and upper bounds for /proc/sys/kernel/threads-max.
* bugfixes for get_pid(). This is the longest part of the patch, but it's only necessary if you have more than 10.000 threads running. If you have enough memory: launch a forkbomb. If ~ 32760 thread are running the kernel enters an endless loop in get_pid() (or around 11000 threads if they intentionally create additional sessions and process groups)
I tested the patch with 2.4.0-test12, but not with newer kernels.
--
Manfred
// $Header$
// Kernel Version:
// VERSION = 2 // PATCHLEVEL = 4 // SUBLEVEL = 0 // EXTRAVERSION = -test12
kernel/sysctl.c +3 -1
@@ -45,6 +45,7 @@extern int bdf_prm[], bdflush_min[], bdflush_max[];extern int sysctl_overcommit_memory;extern int max_threads; +extern int threads_high, threads_low;extern int nr_queued_signals, max_queued_signals;extern int sysrq_enabled;
@@ -222,7 +223,8 @@ 0644, NULL, &proc_dointvec}, #endif {KERN_MAX_THREADS, "threads-max", &max_threads, sizeof(int), - 0644, NULL, &proc_dointvec}, + 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, + &threads_low, &threads_high}, {KERN_RANDOM, "random", NULL, 0, 0555, random_table}, {KERN_OVERFLOWUID, "overflowuid", &overflowuid, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL,
kernel/fork.c +81 -36
161 lines not on this page · raw message
Quoted 5 lines · Manfred Spraul
* bugfixes for
get_pid(). This is the longest part of the patch, but it's only necessary if you have more than 10.000 threads running. If you have enough memory: launch a forkbomb. If ~ 32760 thread are running the kernel enters an endless loop inget_pid()(or around 11000 threads if they intentionally create additional sessions and process groups)
I thought (on Intel) there was a 4092 hard limit?
Chers
Chris
From: "Chris Evans" <[email protected]>
Quoted 3 lines
I thought (on Intel) there was a 4092 hard limit?
That's the 2.2 limit, it's gone.
The new limit is total memory and pid space. The pid's are intentionally limited to 15 bits, the remaining bits are reserved.
In the worst case one running process can block 3 pid values (one for the session, one for the process group, one for process id), thus ~11.000 running processes can exhaust the pid space.
--
Manfred