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?
Here is a comparison of 2.4 and 2.6 on real embedded hardware:
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:
- Kernel Version 2.4.25 from CVS server at www.denx.de,
snapshot of 2005-04-23-00:00
- Kernel Version 2.6.11.7 from kernel.org
plus 8xx v2.6 TLB patch by Marcelo Tosatti (4 Apr 2005)
The following hardware was used for the tests:
- Sandpoint 8240 (MPC8240 at 132 MHz CPU clock, 64 MB RAM)
- TQM860L (MPC860-T at 50 MHz CPU clock, 16 MB RAM)
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 |
| user | 175.3s | 251.5s | + 43 % |
| Uncompressed kernel | 1189.6kB | 1602.8kB | + 35 % |
| sys | 19.6s | 29.4s | + 50 % |
| real | 50.3s | 72.2s | + 43 % |
| Compressed Kernel | 495.8kB | 706.8kB | + 43 % |
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.
Running the lmbench benchmark:
To get some more extensive performance data the
lmbench
benchmark (version 3.0-a4) was run on the systems).
Here the results:
Management Summary:
Using the 2.6 kernel on embedded systems implicates the following disadvantages:
- Slow to build:
2.6 takes 30...40% longer to compile
- Big memory footprint in flash:
the 2.6 compressed kernel image is 30...40% bigger
- Big memory footprint in RAM:
Run with rootfs in ramdisk and run "free" command!!!
- Slow to boot:
2.6 takes 5...15% longer to boot into multi-user mode
- Slow to run
--
WolfgangDenk - 23 Apr 2005