Skip to main content.

Comparing Linux 2.4 and Linux 2.6 Kernels:

Many customers ask for support of Linux Kernel version 2.6 for their embedded projects. This is easy enough to understand: after all, 2.6 is the latest and greatest version of the Linux kernel, and who wants to base a new project on old stuff? They are surprised when we tell them that we don't recommend to use Linux 2.6 for most embedded systems.

Here is a comparison of 2.4 and 2.6 on real embedded hardware that explains why:

Build and Test Environment, Kernel Versions and Test Hardware:

The ELDK 3.1 toolchain was used to build the Linux kernels and to provide the necessary test environment (NFS root filesystem, ramdisk images).

The following versions of the Linux Kernel were used in the tests:

The following hardware was used for the tests:

Building the Kernels:

2.4.25:

2.6.11.7:

Results:

Sandpoint 2.4.25 2.6.11.7 Delta
real 77.7s 101.6s + 31 %
user 268.2s 348.6s + 30 %
sys 28.3s 39.4s + 39 %
Compressed Kernel 887.9kB 1123.5kB + 27 %
Uncompressed kernel 2086.4kB 2513.6kB + 20 %

TQM860L 2.4.25 2.6.11.7 Delta
real 50.3s 72.2s + 43 %
user 175.3s 251.5s + 43 %
sys 19.6s 29.4s + 50 %
Compressed Kernel 495.8kB 706.8kB + 43 %
Uncompressed kernel 1189.6kB 1602.8kB + 35 %

Booting Linux:

The kernel images were booted in the same environment with root filesystem over NFS in an idle network. The timings were recorded in the following log files:

Results:

Time from begin of loading the kernel image into RAM ... 2.4.25 2.6.11.7 Delta
... until "Linux version" message
TQM860L 1.9s 2.0s + 6 %
Sandpoint 13.0s 15.0s + 15 %
... until "Freeing unused kernel memory" message (= enter user space)
TQM860L 3.7s 3.8s + 1 %
Sandpoint 23.0s 22.0s - 4 %
... until "login:" message (= full multi-user mode)
TQM860L 49.7s 58.0s + 17 %
Sandpoint 56.2s 59.6s + 6 %

The slight advantage for the 2.6 when booting is at least partially due to the fact that the configurations were slightly different: in 2.4, the SCSI driver was enabled, which was not the case in 2.6

Running with ramdisk based root file system:

The systems were booted using the ramdisk images provided by the ELDK. The main purpose was to find out how much memory remained free for application code. A simple memory allocator (mem_eat.c) was used to test for free (= allocateable by an application process) memory.

2.4.25:

2.6.11.7:

Results:

Sandpoint 2.4.25 2.6.11.7 up Delta
Kernel Code + Data kB kB + %
total "free" kB kB - % = - kB
Available for malloc() kB kB - % = - kB

TQM860L 2.4.25 2.6.11.7 Delta
Kernel Code + Data 1144kB 1528kB + 34 %
total "free" 15032kB 14676kB - 2 % = - 356kB
Available for malloc() 9024kB 8320kB - 8 % = - 704kB

Running the lmbench benchmark:

To get some more extensive performance data the lmbench benchmark (version 3.0-a4) was run on the systems). The results give a pretty clear and somewhat disappointing picture:

Note that some tests did not run under 2.6 on the MPC860 system because the memory was exhausted (the test system had only 16 MB RAM).

Management Summary:

Using the 2.6 kernel on embedded systems implicates the following disadvantages:

There may be a few cases where the use of Linux kernel version 2.6 makes sense even for embedded systems (typically on "bigger" systems with more powerful processors), but if memory footprint or system performance are important you probably want to stick with a 2.4 kernel for now.

-- WolfgangDenk - 24 Apr 2005


Attachment sort Action Size Date Who Comment
config-2.4.25-TQM860L manage 12.4 K 23 Apr 2005 - 16:39 WolfgangDenk Linux 2.4.25 config file for TQM860L board
uImage-2.4.25-TQM860L manage 495.9 K 23 Apr 2005 - 16:40 WolfgangDenk Linux 2.4.25 U-Boot image for TQM860L board
config-2.4.25-Sandpoint manage 17.1 K 23 Apr 2005 - 16:40 WolfgangDenk Linux 2.4.25 config file for Sandpoint board
uImage-2.4.25-Sandpoint manage 888.0 K 23 Apr 2005 - 16:42 WolfgangDenk Linux 2.4.25 U-Boot image for Sandpoint board
config-2.6.11.7-TQM860L manage 10.4 K 23 Apr 2005 - 16:42 WolfgangDenk Linux 2.6.11.7 config file for TQM860L board
uImage-2.6.11.7-TQM860L manage 706.8 K 23 Apr 2005 - 16:43 WolfgangDenk Linux 2.6.11.7 U-Boot image for TQM860L board
config-2.6.11.7-Sandpoint manage 14.9 K 23 Apr 2005 - 16:44 WolfgangDenk Linux 2.6.11.7 config file for Sandpoint board
uImage-2.6.11.7-Sandpoint manage 1123.5 K 23 Apr 2005 - 16:44 WolfgangDenk Linux 2.6.11.7 U-Boot image for Sandpoint board
BOOTLOG-2.4.25-TQM860L manage 4.0 K 23 Apr 2005 - 17:06 WolfgangDenk Timed bootlog for Linux 2.4.25 on TQM860L board
BOOTLOG-2.4.25-Sandpoint manage 6.3 K 23 Apr 2005 - 17:07 WolfgangDenk Timed bootlog for Linux 2.4.25 on Sandpoint board
BOOTLOG-2.6.11.7-TQM860L manage 3.9 K 23 Apr 2005 - 17:07 WolfgangDenk Timed bootlog for Linux 2.6.11.7 on TQM860L board
BOOTLOG-2.6.11.7-Sandpoint manage 4.9 K 23 Apr 2005 - 17:08 WolfgangDenk Timed bootlog for Linux 2.6.11.7 on Sandpoint board
mem_eat.c manage 0.5 K 24 Apr 2005 - 10:16 WolfgangDenk Simple memory allocator to test for free memory
tosatti.patch manage 4.5 K 24 Apr 2005 - 18:09 WolfgangDenk Tosatti
lmbench_results manage 11.7 K 24 Apr 2005 - 19:10 WolfgangDenk LMBENCH Benchmark Results
lmbench_results_raw.tar.gz manage 103.2 K 24 Apr 2005 - 20:15 WolfgangDenk LMBENCH Benchmark Results (Raw Data)