Re: [2.6 patch] add an -Os config option

From: Adrian Bunk (bunk_at_fs.tum.de)
Date: 08/12/03

  • Next message: Kevin P. Fleming: "Re: [2.6 patch] add an -Os config option"
    Date:	Tue, 12 Aug 2003 17:58:47 +0200
    To: Timothy Miller <miller@techsource.com>
    
    

    On Tue, Aug 12, 2003 at 11:43:50AM -0400, Timothy Miller wrote:
    >
    >
    > Christoph Hellwig wrote:
    > >On Mon, Aug 11, 2003 at 11:11:45PM +0200, Adrian Bunk wrote:
    > >
    > >>The patch below adds an option OPTIMIZE_FOR_SIZE (depending on EMBEDDED)
    > >>that changes the optimization from -O2 to -Os.
    > >
    > >
    > >Please dropt the if EMBEDDED - this makes perfecty sense for lots of
    > >todays hardware..
    > >
    > >In fact we should probably rather do some some benchmarking whether it
    > >would be a good idea to make -Os the default.
    >
    >
    > Interesting thought... In reality, we want the system to spend as
    > little time in the kernel as possible. If we've done that job right,
    > then optimizing for size shouldn't matter as much. We're still spending
    > most of our time in user space.
    >
    > Furthermore, it may be that we could benefit from compiling some source
    > files with -Os and others with -O2, depending on how critical they are
    > and how much they are ACTUALLY affected.
    >...
    > Comments?

    First of all, compiling my own kernel with gcc 3.3.1 resulted in less
    than 10% difference in the size of the kernel image (and ACPI is not
    part of my kernel) - the mere difference in size isn't that important
    except for special needs (like boot _floppies_ or embedded systems
    with very limited memory).

    The benchmarking Christoph was referring to was to check whether a
    kernel completely compiled with -Os is faster than a kernel compiled
    with -O2. This might sound strange, but if the code is smaller more fits
    into the cache and modern CPUs suffer much every time they need to
    access the incredibly slow RAM.

    cu
    Adrian

    -- 
           "Is there not promise of rain?" Ling Tan asked suddenly out
            of the darkness. There had been need of rain for many days.
           "Only a promise," Lao Er said.
                                           Pearl S. Buck - Dragon Seed
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Kevin P. Fleming: "Re: [2.6 patch] add an -Os config option"

    Relevant Pages

    • Getting no sound from ALSA under 2.6.7
      ... I finally decided it was time to upgrade to the 2.6 kernel. ... Has anybody got ALSA working with the alsa-base and alsa-utils currently ... First I tried compiling most stuff into the kernel, ... hear a lot of noise on the speakers. ...
      (Debian-User)
    • Re: FreeBSD 5.1-Release freezes
      ... if I run with this kernel the ... > make installkernel KERNCONF=SOCKETD) ... Try compiling options MAC_DEBUG into your ... If you have DDB compiled into the kernel (which you probably will ...
      (freebsd-current)
    • Re: kernel prbs w/ext USB equip
      ... I guess I'll have to roll my own kernel, ... I don't do any compiling on Ubuntu so I don't know the package ... turn yet one more medium into a coaster. ... alan at linuxholdings dot co dot za ...
      (Ubuntu)
    • Re: [FreeBSD 5.3 STABLE/RC2] SMP crashes
      ... While compiling ATLAS library and working with some other applications, ... With SMP disabled, the box was now stable for over 7 days, also under heavy load. ... > I was in good luck taking the panic kernel report. ... > resetting SCSI bus! ...
      (comp.unix.bsd.freebsd.misc)
    • Re: nvidia driver works w/ new kernel and inittab 3, but not 5
      ... > compiling of the driver, ... The sentence "a *reboot* ... compilation it is loaded running kernel .2179 while after a reboot the ...
      (Fedora)