Szwg Measurement Method

From eLinux.org
Revision as of 12:57, 10 February 2008 by Glenn (talk | contribs) (+Category:Consumer Electronics Linux)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Summary

SZWG focused and examined the following five methods for memory(ROM or RAM) size reduction.

(1)Typical embedded Linux boot(Normalizer) This way of booting up is typically used for embedded Linux system. The Linux kernel is stored in ROM/Flash on the target system. In order to save an area where Linux kernel is stored, the kernel is compressed as zImage. Measurement results for this method is used as normalizer to compare to other methods.

See section 4 for details of this method.

(2)Kernel XIP(eXecute In Place) Kernel XIP is the method that kernel image is directly executed from ROM/Flash, instead of copying from ROM/Flash to RAM. Main pros:Compare to typical boot, RAM usage decreases. Main cons:Compare to typical boot, ROM usage increases, and execution speed is slower.

See section 5 for details of this method.

(3)Compressed FS(initrd) Initrd is a Kernel feature that allows root file system to be in RAM disk. Root file system image is compressed and stored in ROM/Flash. Boot loader (or Kernel) copies the compressed image to RAM and decompress it to RAM (RAM disk). The kernel mount the root file system image as file system. Main pros:Compare to typical boot, ROM usage for filesystem is decreases. Main cons:Compare to typical boot, RAM usage increases.

See section 6 for details of this method.

(4)Compressed FS(cramfs) Cramfs is read-only compressed filesystem. Main pros:Compare to typical boot, ROM usage for filesystem is decreases. Main cons:Read only.

See section 7 for details of this method.

(5)Compressed FS(jffs2) Jffs2 is compressed file system for flash memory. Main pros:ROM usage for filesystem decreases. Main cons:ROM and RAM usage for kernel increases.

See section 8 for details of this method.

In order to clarify effects of memory reduction for each method, following four types of memory usage should be measured. Such as ROM usage for kernel, RAM usage for kernel, ROM usage for filesystem, RAM usage for filesystem.

(a) Kernel ROM size measurement Size of ROM area where kernel image are stored.

(b) Kernel RAM size measurement Size of RAM size where text and data of kernel are (uncompressed and) copied. The size does not include areas temporarily used while uncompressing, areas for bitmaps, and areas freed after bootup.

(c)Root filesystem ROM size measurement Size of ROM area where root filesystem image are stored.

(d)Root filesystem RAM size measurement Size of RAM size where root filesystem image are (uncompressed and) copied.

In addition, in order to clarify side effects for each method, following two items should be measured. Such as booting up time, execution speed.

(e)Booting up time measurement Booting up time should include period for uncompressing and copying kernel and root filesystem from ROM to RAM. Then start point and end point of boot up time are defined as follows: Start point:Entry of bootloader End point:a specific point after prepare_namespace()

(f)Execution speed benchmark Unix'Bench4.1.0 is used for the execution speed benchmark. Unix'Bench can be downloaded from the following URL.

http://www.tux.org/pub/tux/benchmarks/System/unixbench/unixbench-4.1.0.tgz

Unix'Bench contains 9 types of tests which result can be converted "index score" for performance.

(1)Dhrystone 2 using register variables (2)Double-Precision Whetstone (3)Execl Throughput (4)File Copy (5)Pipe Throughput (6)Pipe-based Context Switching (7)Process Creation (8)Shell Script (9)System Call Overhead

The file copy test (4) should be skipped because some of our target filesystems are mounted for read-only. The index score is rate against a baseline score which a 60-MHz Super SPARC processor records. The baseline is rated at 10.0. in each of the index scores. Final score is average of all of the index scores except No.(4).

Details

The details of measurement ways for each method are described below.

Kernel ROM size measurement

(1) Typical embedded Linux boot(Normalizer) Measure size of the zImage file. Execute "ls -l" command, and round off the result value less than kB.

(Ex.)

  1. ls -l ./zImage

(2) Kernel XIP Measure size of the xip image file. Execute "ls -l" command, and round off the result value less than kB.

(Ex.)

  1. ls -l ./ximage

(3) Compressed FS(initrd) Same as the Typical embedded Linux boot.

(4) Compressed FS(cramfs) Same as the Typical embedded Linux boot.

(5) Compressed FS(jffs2) Same as the Typical embedded Linux boot.

Kernel RAM size measurement

(1) Typical embedded Linux boot(Normalizer) Build vmlinux file instead of zImage, execute "objdump -h" command, and then section information of vmlinux will be displayed. Calculate total size of relevant sections, and round off the result value less than kB.

(Ex.)

  1. (prefix-)objdump -h ./vmlinux

(2) Kernel XIP Calculate total size of bss section and data section from System.map file.

(3) Compressed FS(initrd) Same as the Typical embedded Linux boot.

(4) Compressed FS(cramfs) Same as the Typical embedded Linux boot.

(5) Compressed FS(jffs2) Same as the Typical embedded Linux boot.

Root filesystem ROM size measurement

(1) Typical embedded Linux boot(Normalizer) Execute "du -bc" on the target board, and round off the result value less than kB.

(Ex.)

  1. du -bcs /

(2) Kernel XIP Same as the Typical embedded Linux boot.

(3) Compressed FS(initrd) Measure size of the root filesystem image(gzip file). Execute "ls -l" command, and round off the result value less than kB.

(Ex.)

  1. ls -l ./rootfs.gz

(4) Compressed FS(cramfs) Measure size of the cramfs filesystem image created by the mkcramfs. Execute "ls -l" command, and round off the result value less than kB. The cramfs image file must be created under default option of mkcramfs.

(Ex.)

  1. ls -l ./rootfs_cramfs

(5) Compressed FS(jffs2) Measure size of the jffs2 filesystem image created by the mkfs.jffs2. Execute "ls -l" command, and round off the result value less than kB. The jffs2 image file must be created under following conditions. - padding:minimum setting - erase block size:appropriate value for the Flash ROM on the target board.

(Ex.)

  1. ls -l ./rootfs_cramfs

Root filesystem RAM size measurement

(1) Typical embedded Linux boot(Normalizer) Not necessary.

(2) Kernel XIP Not necessary.

(3) Compressed FS(initrd) Measure size of the uncompressed root filesystem image. Execute "ls -l" command, and round off the result value less than kB.

(Ex.)

  1. ls -l ./rootfs

(4) Compressed FS(cramfs) Not necessary.

(5) Compressed FS(jffs2) Not necessary.

Boot up time measurement

Use time measurement function of JTAG ICE to measure the boot up time. Define top of bootloader as a start point of the measurement period, and then set an end point at given places in the init() function. Insert dummy functions at the end points, and set a hardware break point at one of the dummy functions in order to stop execution.

Two dummy functions are inserted in the init() function. -> Szwg Boottime Endpoint

This procedure is common for each method.

Execution speed benchmark

Cross-compile the Unix'Bench4.1.0 for the target board, and then execute it on the board. Run the test 3 times ,and adopt final score from log as result.

(Ex.)

  1. ./Run -3

This procedure is common for each method.