From owner-freebsd-current@FreeBSD.ORG Sat May 26 21:46:51 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9777D16A468; Sat, 26 May 2007 21:46:51 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id 744EB13C45D; Sat, 26 May 2007 21:46:51 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.9] (may be forged)) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l4QLkoiw027287 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 26 May 2007 14:46:51 -0700 X-Auth-Received: from [192.168.10.45] (c-67-166-149-71.hsd1.ca.comcast.net [67.166.149.71]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l4QLkoIY003325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 26 May 2007 14:46:50 -0700 Message-ID: <4658AAF3.5060708@u.washington.edu> Date: Sat, 26 May 2007 14:47:31 -0700 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: Stefan Ehmann References: <20070525095146.GA45288@freebsd.org> <200705251602.48778.shoesoft@gmx.net> <20070525150517.GA63514@freebsd.org> <200705261248.37152.shoesoft@gmx.net> In-Reply-To: <200705261248.37152.shoesoft@gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.1.294258, Antispam-Engine: 2.5.1.298604, Antispam-Data: 2007.5.26.142834 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: Roman Divacky , freebsd-current@freebsd.org Subject: Re: size of kernel after gcc4.2 upgrade X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2007 21:46:51 -0000 Stefan Ehmann wrote: > On Friday 25 May 2007 17:05:17 Roman Divacky wrote: >> On Fri, May 25, 2007 at 04:02:47PM +0200, Stefan Ehmann wrote: >>> On Friday 25 May 2007 11:51:46 Roman Divacky wrote: >>>> hi >>>> >>>> I just noticed that >>>> spravci ~# ls -l /boot/kernel*/kernel >>>> -r-xr-xr-x 1 root wheel 3389971 May 18 12:03 >>>> /boot/kernel.old/kernel* -r-xr-xr-x 1 root wheel 5211345 May 25 >>>> 11:47 /boot/kernel/kernel* >>>> >>>> ie. after gcc42 import the kernel size increased roughly by 60% thats >>>> a little too much. is there any forgotten option or something that >>>> makes the kernel grow so big? >>> While I also see an increase, it's not that much. >>> >>> GENERIC from today's current, also compiled with gcc34 from ports (I had >>> to delete two gcc options in sys/conf/kern.mk): >>> >>> gcc34: 6530916 >>> gcc42: 7352560 >>> gcc34 -Os: 6074468 >>> gcc42 -Os: 10058032 >> yes, thats it! I also used -Os. it looks like this occurs only with -Os >> optimization level. >> >> can someone else confirm this? and/or possibly explain this? > > -Os seems to do more inlining than -O. > > Maybe this is a gcc bug, we use strange options for the buildkernel or who > knows what. > > If I use INLINE_LIMIT=600, I get a more reasonable sized kernel (600 is the > gcc default, /sys/conf/kern.mk sets it to 8000). But it's still larger than > the -O compile. > > If I further lower INLINE_LIMIT to 50: > -Os: 5876816 > -O: 7154096 > > This numbers finally look sane for a -Os build. Doing this is probably not a > good idea but maybe this points to the cause of the size increase. This has been discussed quite a bit in the Gentoo forums with gcc v4.1+. Depending on the architecture and CPU, -Os actually reduced the overall performance greatly. This may or may not have to do with size. For Pentium 4 - Core 2 Duo: -O2 was good. -O3 was better. -Os was the worst. This is one of many discussion threads: . Some food for thought. -Garrett