Commit 49d10c65 authored by David Howells's avatar David Howells Committed by Linus Torvalds

[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: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 74504bb3
...@@ -118,7 +118,11 @@ void __init fork_init(unsigned long mempages) ...@@ -118,7 +118,11 @@ void __init fork_init(unsigned long mempages)
* value: the thread structures can take up at most half * value: the thread structures can take up at most half
* of memory. * 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 * 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