Compiler options for reducing kernel size

The second option is new in gcc 3.4, -funit-at-a-time. This apparently makes gcc
do a much better job of inlining and dead code removal. It reduces the
size of both text and data. It depends on another inlining patch that I
think is in the tiny kernel patch (maybe same idea but different details).

The third option, -mregparm=3, seems to be x86 specific, it instructs the
compiler to use registers for the first three function arguments. by John Rigby

SquashFS file system

For read-only data, it is useful to utilize a compressed file system. The following are used heavily in embedded systems:

GCC Code-Size Benchmarking

CSiBE is a code size benchmark for the GCC compiler. The primary purpose of CSiBE is to monitor the size of the code generated by GCC. In addition, compilation time and code performance measurements are also provided.

Case Studies

Motorola reduction of system size (presumably for cell phones) using 2.4 Linux: see Mot Size Reduction.ppt

Other Tidbits on System Size

Memory leak detection for the kernel

Catalin Marinas of ARM has been recently (as of 2.6.17?) been posting a memory leak detector for the Linux kernel. It may get mainlined in the future. Here's a link to the LKML discussions around it: http://lkml.org/lkml/2006/6/11/39

How System Size may affect performance

It has long been theorized that reducing system size could provide a performance benefit
because it could reduce cache misses. There does not appear to be hard data to support
this theory on Linux, but this has been discussed on the kernel mailing list.