PATCH: 2.5.40 sane minimum proc count

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Sun Oct 06 2002 - 12:21:43 EST


Again from UCLinux merge but relevant on its own for any embedded tiny box

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.2.5.40/kernel/fork.c linux.2.5.40-ac5/kernel/fork.c
--- linux.2.5.40/kernel/fork.c 2002-10-02 21:34:06.000000000 +0100
+++ linux.2.5.40-ac5/kernel/fork.c 2002-10-05 23:51:20.000000000 +0100
@@ -166,8 +166,11 @@
          */
         max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;
 
- init_task.rlim[RLIMIT_NPROC].rlim_cur = max_threads/2;
- init_task.rlim[RLIMIT_NPROC].rlim_max = max_threads/2;
+ /*
+ * we need to allow at least 10 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);
 }
 
 static struct task_struct *dup_task_struct(struct task_struct *orig)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:55 EST