From: Paul M. <le...@li...> - 2007-09-10 09:35:42
|
On Mon, Sep 10, 2007 at 06:19:12PM +0900, Yuichi Nakamura wrote: > > On Mon, 10 Sep 2007 16:09:10 +0900 > Paul Mundt wrote: > > What optimization levels are you using to compile the kernel? Try with > > and without -Os to see if there's a measurable impact. From the sounds of > > it you're still going to have to do the manual inlining work if there's > > no change in the common case, at least. > I was using -O2. > I now compiled with -Os and compared. > > lmbench result for SH(SH4, SH7751R), kernel 2.6.22 > SELinux(gcc4.2.1 -O2) SELinux(gcc 4.2.1 -Os) > Simple read 6.03 4.24 > Simple write 5.92 3.88 > Very strange. -Os is better. > # I tried twice to make sure. > The inlining semantics for both of these are a bit different, but it's curious that -Os resulted in faster code given that it has a tendency to try and keep things that are referenced more than once out-of-line. > No SELinux(gcc4.2.1 -O2) No SELinux(gcc 4.2.1 -Os) > Simple read 2.36 2.45 > Simple write 2.06 2.08 > Without SELinux, O2 is a little better. > What about bumping this to -O3? It seems like the compiler is at least able to produce good code, the main issue is just the optimization level and inlining semantics at this point. On the other hand, with newer compilers we really should be using -Os as the default anyways (this is also the default for most ARM boards), it hasn't been a problem for some time. |