diff options
author | David Howells <dhowells@redhat.com> | 2004-11-10 21:35:19 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-10 21:35:19 -0800 |
commit | 49d10c65aad14a485bf0784048113f908fe8fd38 (patch) | |
tree | 92a8d80e9a0b6757ece2bc6bccd2b20ead1f18e2 /kernel | |
parent | 74504bb310be11392218b30b8b1b6fff426524a5 (diff) | |
download | history-49d10c65aad14a485bf0784048113f908fe8fd38.tar.gz |
[PATCH] fix page size assumption in fork()
The attached patch fixes fork to get rid of the assumption that THREAD_SIZE
>= PAGE_SIZE (on the FR-V the smallest available page size is 16KB).
Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fork.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index eb689d9ce967c8..f5fba87c0f1d40 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -118,7 +118,11 @@ void __init fork_init(unsigned long mempages) * value: the thread structures can take up at most half * of memory. */ - max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8; + if (THREAD_SIZE >= PAGE_SIZE) + max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8; + else + max_threads = mempages / 8; + /* * we need to allow at least 20 threads to boot a system */ |