diff options
author | Albin Tonnerre <albin.tonnerre@free-electrons.com> | 2010-01-08 17:42:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-11 12:34:04 -0500 |
commit | 7dd65feb6c603e13eba501c34c662259ab38e70e (patch) | |
tree | 5ec4bf4ab09310dce796fc7a2067c18d76b4aa75 /init/Kconfig | |
parent | ac4c2a3bbe5db5fc570b1d0ee1e474db7cb22585 (diff) |
lib: add support for LZO-compressed kernels
This patch series adds generic support for creating and extracting
LZO-compressed kernel images, as well as support for using such images on
the x86 and ARM architectures, and support for creating and using
LZO-compressed initrd and initramfs images.
Russell King said:
: Testing on a Cortex A9 model:
: - lzo decompressor is 65% of the time gzip takes to decompress a kernel
: - lzo kernel is 9% larger than a gzip kernel
:
: which I'm happy to say confirms your figures when comparing the two.
:
: However, when comparing your new gzip code to the old gzip code:
: - new is 99% of the size of the old code
: - new takes 42% of the time to decompress than the old code
:
: What this means is that for a proper comparison, the results get even better:
: - lzo is 7.5% larger than the old gzip'd kernel image
: - lzo takes 28% of the time that the old gzip code took
:
: So the expense seems definitely worth the effort. The only reason I
: can think of ever using gzip would be if you needed the additional
: compression (eg, because you have limited flash to store the image.)
:
: I would argue that the default for ARM should therefore be LZO.
This patch:
The lzo compressor is worse than gzip at compression, but faster at
extraction. Here are some figures for an ARM board I'm working on:
Uncompressed size: 3.24Mo
gzip 1.61Mo 0.72s
lzo 1.75Mo 0.48s
So for a compression ratio that is still relatively close to gzip, it's
much faster to extract, at least in that case.
This part contains:
- Makefile routine to support lzo compression
- Fixes to the existing lzo compressor so that it can be used in
compressed kernels
- wrapper around the existing lzo1x_decompress, as it only extracts one
block at a time, while we need to extract a whole file here
- config dialog for kernel compression
[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Tested-by: Wu Zhangjin <wuzhangjin@gmail.com>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Russell King <rmk@arm.linux.org.uk>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init/Kconfig')
-rw-r--r-- | init/Kconfig | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/init/Kconfig b/init/Kconfig index a23da9f01803..d95ca7cd5d45 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -115,10 +115,13 @@ config HAVE_KERNEL_BZIP2 | |||
115 | config HAVE_KERNEL_LZMA | 115 | config HAVE_KERNEL_LZMA |
116 | bool | 116 | bool |
117 | 117 | ||
118 | config HAVE_KERNEL_LZO | ||
119 | bool | ||
120 | |||
118 | choice | 121 | choice |
119 | prompt "Kernel compression mode" | 122 | prompt "Kernel compression mode" |
120 | default KERNEL_GZIP | 123 | default KERNEL_GZIP |
121 | depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA | 124 | depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_LZO |
122 | help | 125 | help |
123 | The linux kernel is a kind of self-extracting executable. | 126 | The linux kernel is a kind of self-extracting executable. |
124 | Several compression algorithms are available, which differ | 127 | Several compression algorithms are available, which differ |
@@ -141,9 +144,8 @@ config KERNEL_GZIP | |||
141 | bool "Gzip" | 144 | bool "Gzip" |
142 | depends on HAVE_KERNEL_GZIP | 145 | depends on HAVE_KERNEL_GZIP |
143 | help | 146 | help |
144 | The old and tried gzip compression. Its compression ratio is | 147 | The old and tried gzip compression. It provides a good balance |
145 | the poorest among the 3 choices; however its speed (both | 148 | between compression ratio and decompression speed. |
146 | compression and decompression) is the fastest. | ||
147 | 149 | ||
148 | config KERNEL_BZIP2 | 150 | config KERNEL_BZIP2 |
149 | bool "Bzip2" | 151 | bool "Bzip2" |
@@ -164,6 +166,14 @@ config KERNEL_LZMA | |||
164 | two. Compression is slowest. The kernel size is about 33% | 166 | two. Compression is slowest. The kernel size is about 33% |
165 | smaller with LZMA in comparison to gzip. | 167 | smaller with LZMA in comparison to gzip. |
166 | 168 | ||
169 | config KERNEL_LZO | ||
170 | bool "LZO" | ||
171 | depends on HAVE_KERNEL_LZO | ||
172 | help | ||
173 | Its compression ratio is the poorest among the 4. The kernel | ||
174 | size is about about 10% bigger than gzip; however its speed | ||
175 | (both compression and decompression) is the fastest. | ||
176 | |||
167 | endchoice | 177 | endchoice |
168 | 178 | ||
169 | config SWAP | 179 | config SWAP |