From owner-freebsd-current@FreeBSD.ORG Fri Dec 23 00:49:46 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 4E6B7106566C; Fri, 23 Dec 2011 00:49:46 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU [18.9.25.14]) by mx1.freebsd.org (Postfix) with ESMTP id CE83F8FC17; Fri, 23 Dec 2011 00:49:45 +0000 (UTC) X-AuditID: 1209190e-b7f8f6d0000008fc-24-4ef3d029c3e9 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id B0.A9.02300.920D3FE4; Thu, 22 Dec 2011 19:49:45 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id pBN0niBl010247; Thu, 22 Dec 2011 19:49:45 -0500 Received: from multics.mit.edu (MULTICS.MIT.EDU [18.187.1.73]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pBN0nhs9023465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 22 Dec 2011 19:49:44 -0500 (EST) Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id pBN0nhPk007578; Thu, 22 Dec 2011 19:49:43 -0500 (EST) Date: Thu, 22 Dec 2011 19:49:42 -0500 (EST) From: Benjamin Kaduk To: Alexander Best In-Reply-To: <20111222192549.GA19008@freebsd.org> Message-ID: References: <4EF34E52.2040905@FreeBSD.org> <20111222192549.GA19008@freebsd.org> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLIsWRmVeSWpSXmKPExsUixCmqrKt54bOfwaS9nBbtn+cxWSzp2sdo MefNByYHZo8Zn+azBDBGcdmkpOZklqUW6dslcGWs6TQsWMlb8W5NP1sD4wGuLkZODgkBE4l1 sycxQthiEhfurWfrYuTiEBLYxyjxZUkXC4SzgVHi360WJgjnAJPE0bb77BBOA6PEj//tTCD9 LALaEpMv/GcGsdkEVCRmvtnIBmKLCGhIbGt4DBZnFnCUWHJzE9g+YQEnif71S8HinAKGEl2v e9lBbF4Be4nNzf/BaoQE/CV+bNgOFhcV0JFYvX8KC0SNoMTJmU9YIGZaSpz7c51tAqPgLCSp WUhSCxiZVjHKpuRW6eYmZuYUpybrFicn5uWlFuka6+VmluilppRuYgSHqiTfDsavB5UOMQpw MCrx8FYVffYTYk0sK67MPcQoycGkJMr78jRQiC8pP6UyI7E4I76oNCe1+BCjBAezkgjviwVA Od6UxMqq1KJ8mJQ0B4uSOK+a1js/IYH0xJLU7NTUgtQimKwMB4eSBG/5eaBGwaLU9NSKtMyc EoQ0EwcnyHAeoOFGIDW8xQWJucWZ6RD5U4yKUuK8/iAJAZBERmkeXC8slbxiFAd6RZg3C6SK B5iG4LpfAQ1mAhq8zfkDyOCSRISUVAOj1pylLKovmV1lci18b0zZ4+fMnX/gTt3lj2f17+/n s5Od9ZQ71qhgtc9NJ7YkQdu6xfGXeSw2/fn4tTz0Jv/dFxfkwnf/tzLqeXxmt5dprsd1F8aJ 0mn2RaZ6M8r4f9oqR8XuTO7UuVvt8VNx95XDRt4XD8b0dul51HWHFDM+UzVgX6X9sUWJpTgj 0VCLuag4EQBAYn0RAAMAAA== Cc: freebsd-current@freebsd.org, Dimitry Andric 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 00:49:46 -0000 On Thu, 22 Dec 2011, Alexander Best wrote: > On Thu Dec 22 11, Dimitry Andric wrote: >> Hi, >> >> I would like to ask some feedback on the attached patch, which cleans up >> the kernel optimization options for amd64. This was touched upon >> earlier by Alexander Best in freebsd-toolchain, here: > > i've been using such settings for a few months now and haven't noticed any > problems. > > however bruce evans raised a good point (in a private mail). when you compile a > kernel without debugging enabled, -O2 is the default. if you experience issues, > and enable debugging, -O0 now becomes the default. in case the problems with > the kernel were caused by the -O2 option and aren't present with the -O0 > option, the newly built kernel with debugging enabled will not help you fix the > problems. in that case you would need to set -O2 explicitly in CFLAGS. his > exact words were: > > " > I don't like -O2 for anything. However, if it is only a default, it is > not a problem provided it can be canceled easily. And for debugging, you > want the default to be the same as without debugging, so that (by default) > you debug the same code that caused the problem. > " > > however i don't think this is fixable. using -O0 for debuggable and > non-debuggable kernels will cause too much of a slowdown. > > having -O2 as the default flag for non-debuggable kernels and -O2 -g for > debuggable kernels might cause situations, where debugging isn't possible, > where with -O0 -g it would have been. > > so i guess although bruces concerns are valid, they are impossible to solve. Where does -O0 come in? I only see talk of -O (i.e. -O1) versus -O2. -Ben Kaduk