mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: Daniel Phillips <phillips@bonn-fries.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Alexander Viro <viro@math.psu.edu>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	linux-kernel@vger.kernel.org
Subject: Re: initramfs buffer spec -- second draft
Date: Tue, 15 Jan 2002 16:59:51 -0700	[thread overview]
Message-ID: <20020115165951.R11251@lynx.adilger.int> (raw)
In-Reply-To: <Pine.GSO.4.21.0201131536480.27390-100000@weyl.math.psu.edu> <E16Qa0W-0001kH-00@starship.berlin> <20020115140436.L11251@lynx.adilger.int> <E16Qcha-0001lF-00@starship.berlin>
In-Reply-To: <E16Qcha-0001lF-00@starship.berlin>; from phillips@bonn-fries.net on Wed, Jan 16, 2002 at 12:09:10AM +0100

On Jan 16, 2002  00:09 +0100, Daniel Phillips wrote:
> On January 15, 2002 10:04 pm, Andreas Dilger wrote:
> > Well, I doubt the difference will be more than a few bytes, if you compare
> > the cpio archive sizes after compression with gzip.
> 
> Side note: I have a hard time understanding the dual thinking that goes
> something like: "we have to save every nanosecond of CPU but wasting disk is
> ok because, um, disk is cheap, and everybody has more than they need anyway,
> and reading it takes zero time and oh yes, everybody has disks, don't they?"

OK, I agree somewhat that we need to save disk space, just as I agree we
should reduce CPU usage.  That said, would you want to save a few CPU
cycles if (for example) it meant we didn't use the ELF binary format,
and had to change?  Yes, we went from a.out to ELF, but it was a major
pain even when Linux was far less widely used.

> > But then every person who wants to build a kernel will have to have
> > the patched version of cpio until such a time it is part of the standard
> > cpio tool...
> 
> If we go with little-endian then only big-endian architectures will need
> the patch, and they tend to need patches for lots of things anyway.  Or
> if you like I'll write a little utility that goes through the file and
> byteswaps all the int fields.

But the proposed cpio format (AFAIK) has ASCII numbers, which is what you
were originally complaining about.  I see that cpio(1) says that "by
default, cpio creates binary format archives... and can read archives
created on machines with a different byte-order".

Excluding alignment issues (which can also be handled relatively easily),
is there a reason why we chose the ASCII format over binary, especially
since the binary format _appears_ to be portable (assuming endian
conversions at decoding time), despite warnings to the contrary?

> > (which may be "never").  I would much rather use the currently
> > available tools than save 20 bytes off a 900kB kernel image.
> 
> What if it's more than 20 bytes?

Well, anything less than half a sector (or a network packet) isn't
really measurable.

Well, a few quick tests show (GNU cpio version 2.4.2), with raw sizes
in "blocks" as output by cpio, compressed sizes in bytes:

find <dir> | cpio -o -H <format> | gzip -9 | wc -c

dir		  bin (default)		newc (proposed)
		  raw	   gzip		  raw	   gzip
/sbin		15121	3289678		12952	2769451
/etc		 8822	 689517		 8996	 693700
/usr/local/sbin	 1895	 385461		 1899	 385764

The binary format reports lots of "truncating inode number", but for
the purpose of initramfs, that is not an issue as we don't anticipate
more than 64k files.  I don't know why the /sbin test is so heavily
in favour of the newc (ASCII) format, but I repeated it to confirm
the numbers.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


  parent reply	other threads:[~2002-01-16  0:01 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-12  8:04 H. Peter Anvin
2002-01-13 19:43 ` Daniel Phillips
2002-01-13 20:08   ` H. Peter Anvin
2002-01-13 19:53 ` Eric W. Biederman
2002-01-13 20:11   ` H. Peter Anvin
2002-01-13 20:58     ` Eric W. Biederman
2002-01-13 21:59       ` Alexander Viro
2002-01-13 22:35         ` Eric W. Biederman
2002-01-13 20:39   ` Alexander Viro
2002-01-15  6:34     ` Daniel Phillips
2002-01-15  6:34     ` Daniel Phillips
2002-01-16 19:19       ` [offtopic] duplicate mails (was: initramfs buffer spec -- second draft) Daniel Phillips
2002-01-15  6:54     ` initramfs buffer spec -- second draft Daniel Phillips
2002-01-16 20:40       ` Bill Davidsen
2002-01-15 15:15     ` Daniel Phillips
2002-01-15 20:03       ` H. Peter Anvin
2002-01-15 20:16         ` Daniel Phillips
2002-01-15 20:14           ` H. Peter Anvin
2002-01-15 23:01             ` Daniel Phillips
2002-01-15 23:47               ` H. Peter Anvin
2002-01-15 21:04           ` Andreas Dilger
2002-01-15 23:09             ` Daniel Phillips
2002-01-15 23:48               ` H. Peter Anvin
2002-01-15 23:59               ` Andreas Dilger [this message]
2002-01-16  0:29                 ` H. Peter Anvin
2002-01-16  3:33                 ` H. Peter Anvin
2002-01-16  3:25           ` Alexander Viro
2002-01-14 18:31   ` Kai Henningsen
2002-01-15  0:26     ` H. Peter Anvin
2002-01-16  2:43   ` Aaron Lehmann
     [not found] <200201120804.AAA19339@cesium.transmeta.com>
2002-01-13  2:00 ` Alexander Viro
2002-01-13  2:17   ` H. Peter Anvin
2002-01-13  4:11     ` Alexander Viro
2002-01-13 19:55   ` Eric W. Biederman

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=20020115165951.R11251@lynx.adilger.int \
    --to=adilger@turbolabs.com \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillips@bonn-fries.net \
    --cc=viro@math.psu.edu \
    /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

all inboxes | Powered by JetHome®