All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: akpm@osdl.org, torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Fork fix fix
Date: Tue, 16 Nov 2004 19:11:42 +0000	[thread overview]
Message-ID: <3262.1100632302@redhat.com> (raw)


The attached patch fixes the fork fix to avoid the divide-by-zero error I'd
previously fixed, but without using any sort of conditional.

Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat fork-2610rc2mm1.diff 
 fork.c |    5 +----
 1 files changed, 1 insertion(+), 4 deletions(-)

diff -uNrp /warthog/kernels/linux-2.6.10-rc2-mm1/kernel/fork.c linux-2.6.10-rc2-mm1-frv/kernel/fork.c
--- /warthog/kernels/linux-2.6.10-rc2-mm1/kernel/fork.c	2004-11-16 11:31:47.732546390 +0000
+++ linux-2.6.10-rc2-mm1-frv/kernel/fork.c	2004-11-16 16:56:30.990473701 +0000
@@ -120,10 +120,7 @@ void __init fork_init(unsigned long memp
 	 * value: the thread structures can take up at most half
 	 * of memory.
 	 */
-	if (THREAD_SIZE >= PAGE_SIZE)
-		max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;
-	else
-		max_threads = mempages / 8;
+	max_threads = mempages / (8 * THREAD_SIZE / PAGE_SIZE);
 
 	/*
 	 * we need to allow at least 20 threads to boot a system

                 reply	other threads:[~2004-11-16 19:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3262.1100632302@redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.