mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PATCH: 2.5.40 sane minimum proc count
Date: Mon, 7 Oct 2002 14:27:00 +0100	[thread overview]
Message-ID: <20021007142700.I18545@parcelfarce.linux.theplanet.co.uk> (raw)


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

why not simply:

	max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;

+	/* we need to allow at least 20 threads to boot a system */
+	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;

i think we're going to see more kernel threads with 2.5 than we did with 2.4;
let's be safer.

-- 
Revolutions do not require corporate support.

             reply	other threads:[~2002-10-07 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-07 13:27 Matthew Wilcox [this message]
2002-10-07 13:44 ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-10-06 17:21 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=20021007142700.I18545@parcelfarce.linux.theplanet.co.uk \
    --to=willy@debian.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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®