Skip to contentSkip to conversation

Linux 2.4.7-ac1

DISCUSSION Paul Larson 3 participants 3 messages Jul 26, 2001

lore
Share & tools
lore
#0 lore raw

I was running the Linux Test Project's latest testsuite against 2.4.7-ac1 and noticed one test failed that did not fail in 2.4.7 and 2.4.6-ac5. The pth_str02 test (simple test that tries to create 1000 threads) could only make it up to 980 threads on my machine. Saw this change in fork.c with 2.4.7-ac1:

- max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 2;
+ max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 16;

Any reason why this was done? I think the max I was ever able to hit before was somewhere around 1018 or so, so it's not that big of a drop. I was just wondering why it was being further limited since I didn't see anything in the changelog about it.

Thanks,
Paul Larson

#1 lore raw
Quoted 9 lines

pth_str02 test (simple test that tries to create 1000 threads) could only make it up to 980 threads on my machine. Saw this change in fork.c with 2.4.7-ac1:

(quoted diff) +1 -1
-       max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 2;
+       max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 16;

Any reason why this was done? I think the max I was ever able to hit before was somewhere around 1018 or so, so it's not that big of a drop. I was just

Im just playing with better choices of parameters to be more conservative about thread allocations

#2 lore raw
In reply to Paul Larson
Quoted 7 lines · Paul Larson

make it up to 980 threads on my machine. Saw this change in fork.c with 2.4.7-ac1:

(quoted diff) +1 -1
-       max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 2;
+       max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 16;

Any reason why this was done?

The old default was to allow up to HALF of the system's memory to be allocated in task structs. Since each task will also want things like page tables, mm_struct, vma's, etc. it was pretty easy to just about KILL a system using nothing but a simple fork bomb, or some other thing running out of hand.

The new default is to set the limit to something safe enough to not run the system completely out of swappable memory. This should protect the system in extreme situations.

If the system administrator wants more tasks in the system, (s)he can always raise the limit in /proc/sys/kernel/threads-max

regards,

Rik
--
Executive summary of a recent Microsoft press release:
"we are concerned about the GNU General Public License (GPL)"

		http://www.surriel.com/

http://www.conectiva.com/ http://distro.conectiva.com/