From: Yuichi N. <yn...@hi...> - 2007-09-11 03:42:32
|
On Mon, 10 Sep 2007 18:35:28 +0900 Paul Mundt wrote: > 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. Thanks for reply, again. I tried -O3. Kernel panic on gcc 3.4.5. On 4.2.1 it booted. SELinux(gcc 4.2.1 -O3) Simple read 4.53 Simple write 4.23 Better than O2, but Os is better. I tried manual inlining with -Os, SELinux(gcc 4.2.1 -Os) + manual inlining Simple read 3.64 Simple write 3.34 It is still effective. > 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. Does it mean, "most people are using -Os now" ? -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ |