Commit ab1180be authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] sane minimum proc count

Again from UCLinux merge but relevant on its own for any embedded tiny box
parent 1af16980
......@@ -166,8 +166,11 @@ void __init fork_init(unsigned long mempages)
*/
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)
......
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