Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 May 2008 13:22:53 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Kris Kennaway <kris@FreeBSD.org>
Cc:        freebsd-net@FreeBSD.org
Subject:   Re: misc/123066: kernel trap with ipsec
Message-ID:  <20080501130050.A93454@delplex.bde.org>
In-Reply-To: <200804250550.m3P5o4f1010354@freefall.freebsd.org>
References:  <200804250550.m3P5o4f1010354@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080501130050.A93454>