From ff710b161f455911bd04e56aa3acbc7d2a03ab9c Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 8 Oct 2002 00:58:13 -0700 Subject: [PATCH] tidy for the max_thread stuff from the kernel list --- kernel/fork.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'kernel') diff --git a/kernel/fork.c b/kernel/fork.c index 9375e08fb8ce..f8620b82f8f5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -165,12 +165,14 @@ void __init fork_init(unsigned long mempages) * of memory. */ max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8; - /* - * we need to allow at least 10 threads to boot a system + * we need to allow at least 20 threads to boot a system */ - init_task.rlim[RLIMIT_NPROC].rlim_cur = max(10, max_threads/2); - init_task.rlim[RLIMIT_NPROC].rlim_max = max(10, max_threads/2); + if(max_threads < 20) + max_threads = 20; + + init_task.rlim[RLIMIT_NPROC].rlim_cur = max_threads/2; + init_task.rlim[RLIMIT_NPROC].rlim_max = max_threads/2; } static struct task_struct *dup_task_struct(struct task_struct *orig) -- cgit v1.2.3