Kernel Size Tuning Guide Config Option Impact

Table Of Contents:

Overview
This page describes examination result which tries to make clear how much impact each config item has for kernel size and RAM usage. Examined config items are basically ones listed in the table in "4.3 Kernel Configuration Options" of Kernel Size Tuning Guide. This result was presented at Japan Technical Jamboree 11], titled "Difference of the Kernel size between "default" and "small" ". Presentation slides are available on the Japan Technical Jamboree 11 page.

Impact of config items
The table below shows kernel size and RAM usage difference between when config item is set as "from" and "to". Most of items are same as listed in "4.3 Kernel Configuration Options" of Kernel Size Tuning Guide, but some were not examined, and several items are added. Please see "note" cell about the reason to be omitted or added. The data were taken from kernel 2.6.16.19 for i386. More detail of measurement conditions are described in "Examination Detail" later.

Column "avail on" means whether the config item is available for vanilla kernel, or for only Linux-Tiny applied kernel.

Kernel Overall Size and RAM Usage
The table below shows static size of kernel configured as "default" and "small". The difference of them means overall impact of config items listed in the table "Impact of config items" above. Please see "Examination detail" about detail of "default" and "small" configurations.

And the table below shows RAM usage of kernel configured as "default" and "small(+)". Please see "Examination detail" about detail of "default" and "small(+)" configurations.

Impact Examination
The examination was basically done by using Kconfig Size tool (see Kernel Config Weight), but partially by manual manipulation because of some limitation of the tool. The overview of method to measure impact is :
 * 1) Make a default .config file by "make defconfig".
 * 2) Change all "=m" in the .config file into "=y".
 * 3) Enable (which means to set "=y") all boolean or tristate examination target config items.This .config file is now called "base config file".
 * 4) Make "base kernel" from the base config file.And then, measure size of the base kernel (S0) and RAM usage (M0).
 * 5) Make examination kernel for each target item.
 * 6) For boolean or tristate config item, make .config file to disable (set "=n") the item, and make kernel from the .config file.
 * 7) For item which has numerical value (ie. int), make .config file to set the item as a certain value, and make kernel from the .config file.
 * 8) Then measure size (Sx) and RAM usage (Mx) of the made kernel.
 * 9) Impact of the config item is calculated as :Impact for size : Sx - X0 Impact for RAM usage : Mx - M0

The base config file used for this examination is [Media:2.6.16.19-tiny-base.config here(2.6.16.19-tiny-base.config)].

Overall size/RAM Usage
The method to measure overall size and RAM usage is very simple, which means making .config files and measure. We used 2 kinds of kernel-sources, and 3 configurations as below.

Note : About RAM Usage Measurement
The definition of "RAM usage" here is amount of RAM which BUDDY system recognizes as in-use just after boot of kernel ( = just before execution of userland ). It should be "just-for-reference" because reproducibility error is known from our experiences.

Tips
Appearing below are "Tips" to help one who tries to examine moreover.


 * CONFIG_XATTR When XATTR=n, EXT3_FS_XATTR=y causes compilation failure. ( EXT3_FS_XATTR=y in defconfig )


 * CONFIG_FILE_LOCKING When FILE_LOKING=n, NFSD=y causes compilation failure. ( NFSD=y in defconfig )


 * CONFIG_LOG_BUF_SHIFT LOG_BUF_SHIFT can't be set unless DEBUG_KERNEL=y because "if DEBUG_KERNEL" in lib/Kconfig. Please make sure to disable below items to make kernel compact, which are "depends on DEBUG_KERNEL" and "default y".
 * DETECT_SOFTLOCKUP
 * DEBUG_PREEMPT
 * DEBUG_MUTEXES
 * FORCED_INLINING


 * CONFIG_PCI Disable ACPI in advance if you want to disable PCI because ACPI selects PCI.


 * CONFIG_PRINTK syslogd needs PRINTK=y. You shouldn't launch syslogd on kernel configured as PRINTK=n.