From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: PATCH: 2.5.40 sane minimum proc count
Date: Sun, 6 Oct 2002 18:21:43 +0100 (BST) [thread overview]
Message-ID: <E17yF67-0001tn-00@the-village.bc.nu> (raw)
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)
next reply other threads:[~2002-10-06 17:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-06 17:21 Alan Cox [this message]
2002-10-07 13:27 Matthew Wilcox
2002-10-07 13:44 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E17yF67-0001tn-00@the-village.bc.nu \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®