From owner-freebsd-current@FreeBSD.ORG Fri Dec 23 17:55:16 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 373EC1065675; Fri, 23 Dec 2011 17:55:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 291028FC15; Fri, 23 Dec 2011 17:55:08 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pBNHt5eo025291 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Dec 2011 19:55:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pBNHt5Bm086700; Fri, 23 Dec 2011 19:55:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pBNHt4qc086699; Fri, 23 Dec 2011 19:55:04 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Dec 2011 19:55:04 +0200 From: Kostik Belousov To: Dimitry Andric Message-ID: <20111223175504.GK50300@deviant.kiev.zoral.com.ua> References: <4EF34E52.2040905@FreeBSD.org> <20111223005932.GA65042@freebsd.org> <25FBBF23-CDFA-429E-966D-A90409D8F2BD@gmail.com> <201112230937.08971.jhb@freebsd.org> <20111223160032.GA18839@freebsd.org> <4EF4B46E.7000405@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gvPIjeLKx76TMoZf" Content-Disposition: inline In-Reply-To: <4EF4B46E.7000405@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Garrett Cooper , Alexander Best , freebsd-current@freebsd.org, Benjamin Kaduk Subject: Re: [patch] Cleaning up amd64 kernel optimization options 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: Fri, 23 Dec 2011 17:55:16 -0000 --gvPIjeLKx76TMoZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 23, 2011 at 06:03:42PM +0100, Dimitry Andric wrote: > On 2011-12-23 17:00, Alexander Best wrote: > ... > >>>Back in the 7.x days, I ran into some code that wasn't easily to debug= =20 > >>>because the compiler optimized things out with -O2 by inlining and > >>otherwise shifting around code, so setting breakpoints in gdb became=20 > >>difficult. So from that point on I've gotten into the habit of doing -O > >>explicitly in make.conf if DEBUG_FLAGS was specified. Just a thought.. > >> > >>I still leave -O2 in, but what I do is this: > >> > >> make DEBUG_FLAGS=3D"-g -fno-inline" > > > >would making -O2 -fno-inline the default flags introduce any major=20 > >slowdown? >=20 > Not major, but a minor slowdown is quite possible, especially on arches > like x86, where call overhead is relatively high, and code caches are > relatively large. >=20 > Anyway, I'd rather get the thread back to my original patch instead of > messing around with the default flags for release, which have been -O2 > for a long time now. If people want to override those for specific > reasons, they can always set COPTFLAGS or DEBUG_FLAGS manually, like > John shows. >=20 > The only thing my patch makes sure of, is that amd64 does the same thing > as all other arches, e.g.: compile with a low optimization settings for > debug (-O, which is equivalent to -O1), compile with arch-specific high > optimization settings for release (-O2 plus whatever is required for the > arch, or lower if optimization breaks things). Release is built with -g for long time, this is where the symbol files in /boot/kernel comes from. --gvPIjeLKx76TMoZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk70wHcACgkQC3+MBN1Mb4inHwCglrnuSVkdnXuSrYzoK7LYwZu2 5oIAoIO8H7mDEKfftcvn6kLxziq3aeKC =moJN -----END PGP SIGNATURE----- --gvPIjeLKx76TMoZf--