From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262029AbUKPQ7E (ORCPT ); Tue, 16 Nov 2004 11:59:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262042AbUKPQ7E (ORCPT ); Tue, 16 Nov 2004 11:59:04 -0500 Received: from mx1.redhat.com ([66.187.233.31]:24977 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S262029AbUKPQ67 (ORCPT ); Tue, 16 Nov 2004 11:58:59 -0500 From: David Howells In-Reply-To: References: <20968.1100619491@redhat.com> <23880.1100621506@redhat.com> To: Linus Torvalds Cc: akpm@osdl.org, linux-kernel@vger.kernel.org Subject: Re: fork pagesize patch 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 16:58:50 +0000 Message-ID: <26707.1100624330@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > > Sorry... I meant warning not error. It doesn't actually stop it building a > > working kernel, but gcc _does_ complain, and not unreasonably, I think. > > I think it _is_ unreasonable. It's like doing > > if (a) > x /= a; Doing it with variables is not exactly the same. The compiler has been told to optimise arithmetic on constants, and as such it has to represent a div-by-0 result, which obviously it can't. Now, I agree that given the if-condition automatically precludes the div-by-0, but maybe that's asking too much. Perhaps I should go and raise hell over it with the gcc posse. > Anyway, to make it not warn, why not change it to > > max_threads = mempages / (8*THREAD_SIZE/PAGE_SIZE); > > instead, and be done with it? And drop the conditional entirely? I can go along with that. > If the thread size is _that_ small that we still divide by zero, color me > impressed. Not unless you spell colour correctly:-) David