Automated reduction of the memory footprint of the Linux kernel

The limited built-in configurability of Linux can lead to expensive code size overhead when it is used in the embedded market. To overcome this problem, we propose the application of link-time compaction and specialization techniques that exploit the a priori known, fixed runtime environment of many embedded systems. In experimental setups based on the ARM XScale and i386 platforms, the proposed techniques are able to reduce the kernel memory footprint with over 16%. We also show how relatively simple additions to existing binary rewriters can implement the proposed techniques for a complex, very unconventional program, such as the Linux kernel. We note that even after specialization, a lot of seemingly unnecessary code remains in the kernel and propose to reduce the footprint of this code by applying code-compression techniques. This technique, combined with the previous ones, reduces the memory footprint with over 23% for the i386 platform and 28% for the ARM platform. Finally, we pinpoint an important code size growth problem when compaction and compression techniques are combined on the ARM platform.

[1]  David W. Wall,et al.  Link-time optimization of address calculation on a 64-bit architecture , 1994, PLDI '94.

[2]  Koen De Bosschere,et al.  Link-Time Optimization of IA64 Binaries , 2004, Euro-Par.

[3]  Ulrik Pagh Schultz,et al.  Java bytecode compression for low-end embedded systems , 2000, TOPL.

[4]  Christopher W. Fraser,et al.  Bytecode compression via profiled grammar rewriting , 2001, PLDI '01.

[5]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[6]  Craig Partridge,et al.  Improving UNIX kernel performance using profile based optimization , 1994 .

[7]  Bilha Mendelson,et al.  Profile-Directed Restructuring of Operating System Code , 1998, IBM Syst. J..

[8]  Amir Roth,et al.  A DISE implementation of dynamic code decompression , 2003, LCTES.

[9]  Koen De Bosschere,et al.  Sifting out the mud: low level C++ code reuse , 2002, OOPSLA '02.

[10]  Christopher W. Fraser,et al.  Code compression , 1997, PLDI '97.

[11]  K. De Bosschere,et al.  DIABLO: a reliable, retargetable and extensible link-time rewriting framework , 2005, Proceedings of the Fifth IEEE International Symposium on Signal Processing and Information Technology, 2005..

[12]  Amir Roth,et al.  A DISE implementation of dynamic code decompression , 2003 .

[13]  Saumya K. Debray,et al.  Alias analysis of executable code , 1998, POPL '98.

[14]  Chandra Krintz,et al.  Using phase behavior in scientific application to guide Linux operating system customization , 2005, 19th IEEE International Parallel and Distributed Processing Symposium.

[15]  Michael Hind,et al.  Pointer analysis: haven't we solved this problem yet? , 2001, PASTE '01.

[16]  David E. Culler,et al.  The nesC language: A holistic approach to networked embedded systems , 2003, PLDI.

[17]  Christopher W. Fraser Automatic inference of models for statistical code compression , 1999, PLDI '99.

[18]  Todd A. Proebsting Optimizing an ANSI C interpreter with superoperators , 1995, POPL '95.

[19]  Michael Franz Adaptive Compression of Syntax Trees and Iterative Dynamic Code Optimization: Two Basic Technologies for Mobile Object Systems , 1996, Mobile Object Systems.

[20]  Gregory R. Andrews,et al.  PLTO: A Link-Time Optimizer for the Intel IA-32 Architecture , 2007 .

[21]  Darko Kirovski,et al.  Procedure Based Program Compression , 2004, International Journal of Parallel Programming.

[22]  Saumya K. Debray,et al.  Profile-guided code compression , 2002, PLDI '02.

[23]  Koen De Bosschere,et al.  Link-time compaction and optimization of ARM executables , 2007, TECS.

[24]  Carl Staelin,et al.  lmbench: Portable Tools for Performance Analysis , 1996, USENIX Annual Technical Conference.

[25]  Harish Patil,et al.  Kernel Optimizations and Prefetch with the Spike Executable Optimizer , 2001 .

[26]  William Pugh,et al.  Compressing Java class files , 1999, PLDI '99.

[27]  Bjorn De Sutter,et al.  Post-pass compaction techniques , 2003, CACM.

[28]  De BosschereKoen,et al.  Automated reduction of the memory footprint of the Linux kernel , 2007 .

[29]  Robert Muth,et al.  alto: a link‐time optimizer for the Compaq Alpha , 2001 .

[30]  Fang Yu Code Compression ∗ , 2006 .

[31]  Wei-Tsong Lee,et al.  An Application-Oriented Linux Kernel Customization for Embedded Systems , 2004, J. Inf. Sci. Eng..

[32]  Calton Pu,et al.  Remote customization of systems code for embedded devices , 2004, EMSOFT '04.

[33]  Norman Rubin,et al.  Spike: an optimizer for alpha/NT executables , 1997 .

[34]  Dynamic Kernel Code Optimization , 1998 .

[35]  Julia L. Lawall,et al.  Proceedings of the 2002 Usenix Annual Technical Conference Think: a Software Framework for Component-based Operating System Kernels , 2022 .

[36]  Calton Pu,et al.  Specialization tools and techniques for systematic optimization of system software , 2001, TOCS.

[37]  Gadi Haber,et al.  Reducing program image size by extracting frozen code and data , 2004, EMSOFT '04.

[38]  Jay Lepreau,et al.  The Flux OSKit: a substrate for kernel and language research , 1997, SOSP.

[39]  Koen De Bosschere,et al.  Combining Global Code and Data Compaction , 2001, OM '01.

[40]  Robert K. Montoye,et al.  A decompression core for PowerPC , 1998, IBM J. Res. Dev..

[41]  Koen De Bosschere,et al.  Link-time binary rewriting techniques for program compaction , 2005, TOPL.

[42]  Bjorn De Sutter,et al.  Compiler techniques for code compaction , 2000, TOPL.

[43]  Jörg Henkel,et al.  CoCo: a hardware/software platform for rapid prototyping of code compression technique , 2003, Proceedings 2003. Design Automation Conference (IEEE Cat. No.03CH37451).

[44]  Koen De Bosschere,et al.  Link-time optimization of ARM binaries , 2004, LCTES '04.

[45]  Michael Franz,et al.  Slim binaries , 1997, CACM.

[46]  Frank Piessens,et al.  A survey of customizability in operating systems research , 2002, CSUR.

[47]  Koen De Bosschere,et al.  alto: a link-time optimizer for the Compaq Alpha , 2001, Softw. Pract. Exp..

[48]  Montserrat Ros,et al.  Compiler optimization and ordering effects on VLIW code compression , 2003, CASES '03.

[49]  Dominique Chanet,et al.  System-wide compaction and specialization of the linux kernel , 2005, LCTES '05.

[50]  Barton P. Miller,et al.  Fine-grained dynamic instrumentation of commodity operating system kernels , 1999, OSDI '99.