aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2004-11-16 01:29:15 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-16 01:29:15 -0800
commitbf93c797fad06c40b947ccf65d17a049e9c3fd88 (patch)
treeed411591e1667b740ccaeeac7dff0411eefde093 /kernel
parentccf8b270f7a2ec8193e6460456cf1cd081fb7a99 (diff)
downloadhistory-bf93c797fad06c40b947ccf65d17a049e9c3fd88.tar.gz
[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: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index f5fba87c0f1d40..f157ad672906c3 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -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