From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262105AbUKPTMP (ORCPT ); Tue, 16 Nov 2004 14:12:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262107AbUKPTMP (ORCPT ); Tue, 16 Nov 2004 14:12:15 -0500 Received: from mx1.redhat.com ([66.187.233.31]:2285 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S262105AbUKPTL5 (ORCPT ); Tue, 16 Nov 2004 14:11:57 -0500 From: David Howells To: akpm@osdl.org, torvalds@osdl.org cc: linux-kernel@vger.kernel.org Subject: [PATCH] Fork fix fix User-Agent: EMH/1.14.1 SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Date: Tue, 16 Nov 2004 19:11:42 +0000 Message-ID: <3262.1100632302@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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