public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: initramfs optimization suggestions
Date: Wed, 06 Aug 2008 17:25:35 -0700	[thread overview]
Message-ID: <489A40FF.1000508@zytor.com> (raw)
In-Reply-To: <ac9c93b10808050042u496bfa10nad7962eb0e9ec015@mail.gmail.com>

Frans Meulenbroeks wrote:
> 
> First proposal:
> ==========
> 
> initramfs is build from a compressed cpio archive.
> Proposal is to introduce a build option to make the compression and
> decompression optional.
> Rationale 1: could be faster as it trades off I/O time (to read the
> image) against decompression time
> Rationale 2: for architectures that use compressed images (bzImage)
> actually we compress twice, which is not really efficient.
> 
> I can implement this, but before spending time on it I would like to know if
> a) people consider this a good idea
> b) no one else already has doen this.
>

It already is optional.  If you don't want to compress it, don't.

Perhaps what you are referring to is the initramfs that is optionally 
built out of the kernel tree?

You are (correctly) pointing out that if the image is already 
compressed, it doesn't gain from additional compression, but that would 
increase the operational memory footprint during expansion.

> 
> Second proposal:
> ============
> 
> after decompressing the cpio archive all files are made using
> sys_open/sys_write/sys_close and friends.
> This implies that a lot of system calls and data copying is done.
> It would be nice if that could be avoided.
> I'm not fully into all details of how ramfs is implemented, but would
> it be possible to e.g. dump all blocks of a tmp ram fs into a data
> structure (e.g.an array of blocks) while making the kernel, and while
> booting the kernel initialise the fs cache with these data? (I guess
> this would be around fs/dcache.c; I understand the data here is
> kmalloc-ed, but it might be possible to initialise the cache with
> pointers to that data structure; due to the nature of ramfs they won't
> be deallocated anyway I assume).
> Does this sound feasible? Hidden snags? Appreciate your
> opinion/feedback/suggestions.
> 

The current code has a lot of advantages in terms of code complexity, 
however.  Your proposal would come with a dramatic increase in complexity.

	-hpa


  parent reply	other threads:[~2008-08-07  0:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05  7:42 initramfs optimization suggestions Frans Meulenbroeks
2008-08-05  8:39 ` Matthias Kaehlcke
2008-08-07  0:25 ` H. Peter Anvin [this message]
2008-08-07  7:11   ` Frans Meulenbroeks
2008-08-07 17:28     ` H. Peter Anvin
2008-08-08  6:53       ` Frans Meulenbroeks
2008-08-08 10:06         ` Frans Meulenbroeks

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=489A40FF.1000508@zytor.com \
    --to=hpa@zytor.com \
    --cc=fransmeulenbroeks@gmail.com \
    --cc=linux-kernel@vger.kernel.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