From owner-cvs-src@FreeBSD.ORG Fri Jul 25 14:21:45 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C9EA337B422; Fri, 25 Jul 2003 14:21:45 -0700 (PDT) Received: from cirb503493.alcatel.com.au (c211-28-27-130.belrs2.nsw.optusnet.com.au [211.28.27.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2094343FA3; Fri, 25 Jul 2003 14:21:44 -0700 (PDT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])h6PLLggh035317; Sat, 26 Jul 2003 07:21:42 +1000 (EST) (envelope-from jeremyp@cirb503493.alcatel.com.au) Received: (from jeremyp@localhost) by cirb503493.alcatel.com.au (8.12.8/8.12.8/Submit) id h6PLLgfe035316; Sat, 26 Jul 2003 07:21:42 +1000 (EST) Date: Sat, 26 Jul 2003 07:21:42 +1000 From: Peter Jeremy To: Poul-Henning Kamp Message-ID: <20030725212142.GB9176@cirb503493.alcatel.com.au> References: <20030722231656.GA9715@HAL9000.homeunix.com> <16474.1058916504@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16474.1058916504@critter.freebsd.dk> User-Agent: Mutt/1.4.1i cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern init_main.c kern_malloc.c md5c.c subr_autoconf.c subr_mbuf.c subr_prf.c tty_subr.c vfs_cluster.c vfs_subr.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2003 21:21:46 -0000 On Wed, Jul 23, 2003 at 01:28:24AM +0200, Poul-Henning Kamp wrote: >Please remember that the problem at hand is getting -Werror back >on the kernel so we can catch issues like the warning in umtx. Why is -Werror such a holy grail? The warnings are still there - developers should be able to use script(1) or output redirection and grep(1) to find them. Not having -Werror has the benefit that you get to see all the warnings and make doesn't just die at the first error. I agree that warnings should be minimised so you can easily see new warnings but in some cases, compiler warnings are wrong or require code obfuscation to quieten. At least in the past, gcc could not do sufficient data-flow analysis to correctly determine uninitialised variables when the variable in question was only used within conditionally executed code - and it erred on the side of caution. Removing this warning means adding an unnecessary initialisation - increasing code size and reducing performance (admittedly trivially). Likewise, is "(type *)(intptr_t)foo" any clearer than "(type *)foo" to remove "const" or "volatile". It definitely increases the "code complexity" (as per McCabe or similar). >My experiments have shown that if we had just raised the limit high >enough to inline everything that we have marked as inline, the >GENERIC kernel text segment would have grown by more than 100 k. > >The inlines I have removed today have all been inlines which GCC >has previously ignored and which added significant code segment >size, typically 2k+. > >You can see some of my raw data here: http://phk/misc/inline.txt These all discuss static code size. Aside from the regular "what can we remove from the kernel so it fits on the boot-floppy again" threads, static code size is irrelevant. The critical issue is kernel performance - which on high-end processors is more dependent on how much code gets moved from RAM into cache and secondarily on the amount of code executed. "More code" does not translate to "more code executed" - quite a number of optimisation techniques demonstrate the opposite. The objective is to minimise the length of the most common code paths and either eliminate branches or ensure that the CPU predicts them correctly - if this means that a rarely executed code path bloats, this is still a win. Peter