public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alain Knaff <alain@knaff.lu>
To: Leon Woestenberg <leon.woestenberg@gmail.com>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] init: bzip2 or lzma -compressed kernels and initrds
Date: Sun, 07 Sep 2008 00:59:25 +0200	[thread overview]
Message-ID: <48C30B4D.7030700@knaff.lu> (raw)
In-Reply-To: <c384c5ea0809061529g2c7280d8j216f7791ceeb439a@mail.gmail.com>

Leon Woestenberg wrote:
> Hello,
> 
> a small remark on the non-code parts:
> 
> On Sat, Sep 6, 2008 at 11:19 PM, Alain Knaff <alain@knaff.lu> wrote:
>> compressing the kernel with bzip2 or lzma rather than gzip. Both
>> compressors give smaller sizes than gzip.  Moreover, lzma's
>> decompresses faster than gzip.
>>
> versus
> 
>> +config KERNEL_GZIP
>> +       bool "Gzip"
>> +       help
>> +         The old and tried gzip compression. Its compression ratio is
>> +        the poorest among the 3 choices; however its speed (both
>> +        compression and decompression) is the fastest.
>> +
> 
> This seems contradictionary information.

Oops, sorry for that. Actually the Kconfig text is correct. On
decompression, Lzma is faster than bzip2 but slower than gzip:

Compressor	Compression	Decompression	Size
gzip -9		1,01s		0,11s		833069
lzma -9		3,43s		0,24s		705125
bzip2 -9	2,88s		0,38s		777706

On compression, lzma is actually slowest of the 3, but that should be of
little concern, as this happens only once, whereas decompression happens
many times (on each boot).

So, overall lzma looks like the best (acceptable decompression speed,
best decompression ratio). I only included Bzip2 because it's much
better known than lzma.

> However, I welcome more compression options in kernel and filesystem
> land, so I'm very interested in this patch.

Thanks for your interest and warm welcome :)

> Recently, on the filesystem side there seems to be some effort to
> modularize the decompressors, instead of the use of #ifdef's.
> 
> The other architectures (especially used in embedded) need to hook in
> on this, getting rid of the many out-of-tree patches for kernel/fs
> decompression.
> 
> Regards,

Unfortunately, I didn't have any such machine available for testing, so
I just for Intel 32/64.

However, the changes in the Assembly part (head_32.S and head_64.S) are
trivial, so should be easy to port. The only change to these files is
the offset where the uncompressed size of the file may be found (4 bytes
from the end for gzip, and 5 from the start for lzma).

misc.c, where the bulk of the "architecture-specific" change is, is
actually not that architecture-specific, and could maybe be moved to a
common part? Diff'ing the boot/compressed/misc.c's of various
architectures shows (at first glance) mostly version differences: some
architectures get some changes/enhancements earlier than others. It's as
if the various architectures were stuck at some different points in the
past as compared to Intel...

most of the other files are architecture-independant anyways (the stuff
in lib/ and init/)

Alain

  reply	other threads:[~2008-09-06 22:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-06 21:19 [PATCH] init: bzip2 or lzma -compressed kernels and initrds Alain Knaff
2008-09-06 22:29 ` Leon Woestenberg
2008-09-06 22:59   ` Alain Knaff [this message]
2008-09-07  6:17     ` Rob Landley
2008-09-08  8:35       ` H. Peter Anvin
2008-09-08 13:14       ` Jörn Engel
2008-09-07  3:18 ` H. Peter Anvin
2008-09-07  4:35   ` Steven Noonan
2008-09-07  4:46     ` H. Peter Anvin
2008-09-07  7:40       ` Alain Knaff
2008-09-07 16:30         ` H. Peter Anvin
2008-09-07  7:39   ` Alain Knaff
2008-09-07  8:03     ` Yinghai Lu
2008-09-07  9:17       ` Alain Knaff
2008-09-07  5:48 ` Willy Tarreau
2008-09-07  8:59   ` Alain Knaff
2008-09-15  1:37   ` Rob Landley
2008-09-15 12:46     ` Frans Meulenbroeks
2008-09-15 17:13       ` Bill Davidsen
2008-09-15 17:28         ` Steven Noonan
2008-09-26 18:53           ` Leon Woestenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C30B4D.7030700@knaff.lu \
    --to=alain@knaff.lu \
    --cc=leon.woestenberg@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox