public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Willy Tarreau <w@1wt.eu>
Cc: Alain Knaff <alain@knaff.lu>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] init: bzip2 or lzma -compressed kernels and initrds
Date: Sun, 14 Sep 2008 20:37:47 -0500	[thread overview]
Message-ID: <200809142037.48204.rob@landley.net> (raw)
In-Reply-To: <20080907054831.GA2244@1wt.eu>

On Sunday 07 September 2008 00:48:31 Willy Tarreau wrote:
> Hi Alain,
> > +config KERNEL_LZMA
> > +       bool "LZMA"
> > +       help
> > +         The most recent compression algorithm.
> > +	 Its ratio is best, decompression speed is between the other
> > +	 2. Compression is slowest.
> > +	 The kernel size is about 33 per cent smaller with lzma,
> > +	 in comparison to gzip.
>
> isn't memory usage in the same range as bzip2 ?

Last I checked it was more.  (I very vaguely recall somebody saying 16 megs 
working space back when this was first submitted to busybox, but that was a 
few years ago...)

A quick Google found a page that benchmarks them.  Apparently it depends 
heavily on which compression option you use:

http://tukaani.org/lzma/benchmarks

Something compressed with lzma -6 takes 5 megabytes to decompress, -7 takes 9 
megs, -8 takes 17 megs, and -9 takes 33.  (Plus your source and target 
buffers for in-memory compression.)

So decompressing anything more than an "allnoconfig" kernel with lzma -6 
probably wouldn't quite fit in 8 megs (800k source data, 2.5 megs destination 
data, 5 megs working space... boing.).  You'd need to bump up to 12 or so.  
And compressed with -7 or -8 you're talking 32 megs or more.

> > +# Bzip2
> > +#
> > -------------------------------------------------------------------------
> >-- +
> > +# Bzip2 does not include size in file... so we have to fake that
> > +size_append=perl -e 'print(pack("i",(stat($$ARGV[0]))[7]));'
> > +
> > +quiet_cmd_bzip2 = BZIP2    $@
> > +cmd_bzip2 = (bzip2 -9 < $< ; $(size_append) $<) > $@
>
> It would be the only command in the build process that requires perl. While
> not a disaster, it's a bit annoying to introduce a new build dependency.

While I despise requiring perl to build the kernel, I'd like to point out that 
H. Peter Anvin introduced Perl as a build requirement for 2.6.25:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=bdc807871d58285737d50dc6163d0feb72cb0dc2

Before that perl was only required for optional things like bloat-o-meter, not 
to actually _build_ the kernel.

My argument about it with him and Sam Ravnborg back in February was at:
http://lkml.org/lkml/2008/2/15/541

And their position was "perl is inevitable, go ahead and add python too if you 
like".  Apparently your build environment can have an infinite number of 
requirements, including things like perl where the implementation is the 
spec.  (There is no perl spec, there's only a perl implementation.  Python at 
least has a java implementation...)

My updated patch to remove the dependency from 2.6.26 was here:
http://www.mail-archive.com/linux-embedded%40vger.kernel.org/msg00748.html

Rob

  parent reply	other threads:[~2008-09-15  1:37 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
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 [this message]
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=200809142037.48204.rob@landley.net \
    --to=rob@landley.net \
    --cc=alain@knaff.lu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=w@1wt.eu \
    /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