misc/123066: kernel trap with ipsec

Bruce Evans brde at optusnet.com.au
Thu May 1 03:22:57 UTC 2008


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


More information about the freebsd-net mailing list