From owner-freebsd-net@FreeBSD.ORG Thu May 1 03:22:57 2008 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F8EC106564A for ; Thu, 1 May 2008 03:22:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id CEBB18FC0C for ; Thu, 1 May 2008 03:22:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c220-239-252-11.carlnfd3.nsw.optusnet.com.au (c220-239-252-11.carlnfd3.nsw.optusnet.com.au [220.239.252.11]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m413Mr2N025083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 May 2008 13:22:54 +1000 Date: Thu, 1 May 2008 13:22:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Kris Kennaway In-Reply-To: <200804250550.m3P5o4f1010354@freefall.freebsd.org> Message-ID: <20080501130050.A93454@delplex.bde.org> References: <200804250550.m3P5o4f1010354@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@FreeBSD.org Subject: Re: misc/123066: kernel trap with ipsec X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2008 03:22:57 -0000 On Fri, 25 Apr 2008, Kris Kennaway wrote: > Unfortunately we need the rest of the stack. Can you either try to > reproduce with DDB in the kernel and obtain a stack trace from there, > or if this is not possible then try recompiling the kernel with -O > instead of -O2 which tends to produce better stack traces. I wonder why there haven't been more reports of gcc-4.2 -O[2] breaking things (I probably read the wrong lists). -O2 almost completely breaks kernel profiling and debugging using ddb, mainly by inlining functions that are only used once. Even -O is documented as enabling -funit-at-a-time, which is documented as enabling -finline-functions-called-once. -funit-at-a-time gives the possibility of inlining functions that are instantiated before they are used, and then -finline-functions-called-once tends to inline them. However, this doesn't seem to happen very often with only -O. Maybe -O only inlines small functions, but -O2 inlines all functions that are only called once. Losing the symbols and frames for large inlined functions is especially annoying. I started using -O2 for kernels about a year ago because although it it has little effect (usually negative) in normal use, it gave an optimization of a whole 1 to 5% in network microbenchmarks that I was working on. Bruce