
From: David Howells <dhowells@redhat.com>

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>
---

 25-akpm/kernel/fork.c |    5 +++++
 1 files changed, 5 insertions(+)

diff -puN kernel/fork.c~fix-page-size-assumption-in-fork kernel/fork.c
--- 25/kernel/fork.c~fix-page-size-assumption-in-fork	Mon Nov  8 14:48:37 2004
+++ 25-akpm/kernel/fork.c	Mon Nov  8 14:48:37 2004
@@ -118,7 +118,12 @@ void __init fork_init(unsigned long memp
 	 * 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;
+#endif
+
 	/*
 	 * we need to allow at least 20 threads to boot a system
 	 */
_
