Commit bf93c797 authored by David Howells's avatar David Howells Committed by Linus Torvalds

[PATCH] Fork fix fix

The attached patch fixes the fork fix to avoid the divide-by-zero error I'd
previously fixed, but without using any sort of conditional.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ccf8b270
......@@ -118,10 +118,7 @@ void __init fork_init(unsigned long mempages)
* value: the thread structures can take up at most half
* of memory.
*/
if (THREAD_SIZE >= PAGE_SIZE)
max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;
else
max_threads = mempages / 8;
max_threads = mempages / (8 * THREAD_SIZE / PAGE_SIZE);
/*
* we need to allow at least 20 threads to boot a system
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment