Announcement

Collapse
No announcement yet.

Benchmarking The Linux Kernel With An "-O3" Optimized Build

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Benchmarking The Linux Kernel With An "-O3" Optimized Build

    Phoronix: Benchmarking The Linux Kernel With An "-O3" Optimized Build

    Stemming from last weeks Linux kernel patches suggesting an -O3 experimental option for all CPU architectures and Linus Torvalds rather quickly shooting it down, here are some fresh benchmarks looking at the Linux kernel performance when the kernel image is rebuilt with the -O3 optimization level rather than -O2.

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    thankfully that is already long pre-tested by #t2sde, and even more smarter, thanks to the dynamic compiler wrapper and selectively optimizing hot code path files -O3 and everything else -Os ;-) https://www.youtube.com/watch?v=PtDBDziXMg4

    Comment


    • #3
      I'd be curious to see how O2, O3, Os and the march options from https://github.com/graysky2/kernel_compiler_patch under GCC and Clang would fair

      I've been using O3, -march=native Clang & LTO without any hiccups

      Comment


      • #4
        Talking about difference in compilation times?

        Comment


        • #5
          Thank you Michel for taking a look at it, and providing data on the discussion. You are probably the best person to trust with those benchmarks, it is a different discussion on viability of -O3 seeing how little it improves things in most cases, but at least there weren't any regressions.

          Comment


          • #6
            Gee. Linus knew what he was talking about. Who knew?

            Comment


            • #7
              Michael great Benchmark I guess this is what Linus has requested

              So yes Kernel profits but mostly only slightly. I will continue compiling it with -O3 plus other FLAGS


              Originally posted by FireBurn View Post
              I'd be curious to see how O2, O3, Os and the march options from https://github.com/graysky2/kernel_compiler_patch under GCC and Clang would fair

              I've been using O3, -march=native Clang & LTO without any hiccups
              I'm compiling it with AOCC -march=znver2 -03 and ThinLTO sofar only some modules do not build (xen sound interface for instance) but well nothing concerning my setup. I guess the AMD gfx driver should profit quite well.
              Last edited by CochainComplex; 29 June 2022, 10:40 AM.

              Comment


              • #8
                Originally posted by stormcrow View Post
                Gee. Linus knew what he was talking about. Who knew?
                Mh yes. But there was so far no sudden apocalyptic showstopper as speculated either.

                Comment


                • #9
                  I think having -march=native gives more performance gains, than -O2 => -O3 transition.

                  Comment


                  • #10
                    I think the results should be interpreted otherwise.
                    It's not strange that you don't see any benefits from something that spends < 1% cpu time in kernelspace.
                    If you're measuring an entire system then yeah, perhaps not that much difference.

                    But as the synthetic tests measuring syscalls or actual kernel operations (like context switching)...
                    Then wow did that O3 flag mean improvement!

                    In summary: It's unfair to say that it doesn't help the kernel when measuring an entire system.

                    Comment

                    Working...
                    X