mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arvind Sankar <nivedita@alum.mit.edu>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg Thelen <gthelen@google.com>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH] initramfs: don't double-compress built-in initramfs if the kernel is compressed
Date: Tue, 4 Feb 2020 11:29:17 -0500	[thread overview]
Message-ID: <20200204162917.GA1772390@rani.riverdale.lan> (raw)
In-Reply-To: <CAK7LNAQq7ah1yLOr-fgH-Oo7_NHzvYiy6huY1=4DxJoCGi+cmw@mail.gmail.com>

On Tue, Feb 04, 2020 at 11:22:19AM +0900, Masahiro Yamada wrote:
> Hi.
> 
> On Tue, Feb 4, 2020 at 6:16 AM Arvind Sankar <nivedita@alum.mit.edu> wrote:
> >
> > If the kernel is going to be compressed anyway, there is no point in
> > double-compressing the built-in initramfs. Hide the built-in initramfs
> > compression choice in this case.
> >
> > Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
> 
> 
> Double-compression slightly reduces the data size.
> And, keeping the bare vmlinux small is beneficial, IMHO.
> 

Ok. In my setup (kernel is compressed by xz), none for the builtin
initramfs is optimal by a measurable amount, but I that will depend on
config/initramfs contents/compression methods, so might well not be true
in general. Maybe add a note to the help text?

none    7030816 arch/x86/boot/bzImage
gz      7382144 arch/x86/boot/bzImage
bz2     7353696 arch/x86/boot/bzImage
lzma    7118176 arch/x86/boot/bzImage
xz      7126400 arch/x86/boot/bzImage
lzo     7379360 arch/x86/boot/bzImage
lz4     7335712 arch/x86/boot/bzImage


diff --git a/usr/Kconfig b/usr/Kconfig
index a6b68503d177..b68910b225fc 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -125,6 +125,12 @@ choice
 	  low on RAM, since it reduces the memory consumption during
 	  boot.
 
+	  Note that if the kernel itself is compressed, the builtin initramfs
+	  will be compressed twice, first by the algorithm selected here, and
+	  then by the kernel compression method chosen. This may increase the
+	  final image size, so you should test whether compressing the builtin
+	  initramfs provides any savings.
+
 	  Keep in mind that your build system needs to provide the appropriate
 	  compression tool to compress the generated initram cpio file for
 	  embedding.

      reply	other threads:[~2020-02-04 16:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 16:47 [PATCH] initramfs: do not show compression mode choice if INITRAMFS_SOURCE is empty Masahiro Yamada
2020-02-03 17:33 ` Linus Torvalds
2020-02-03 17:35 ` Linus Torvalds
2020-02-06  1:53   ` Masahiro Yamada
2020-02-03 20:06 ` Arvind Sankar
2020-02-03 21:16   ` [PATCH] initramfs: don't double-compress built-in initramfs if the kernel is compressed Arvind Sankar
2020-02-04  2:22     ` Masahiro Yamada
2020-02-04 16:29       ` Arvind Sankar [this message]

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=20200204162917.GA1772390@rani.riverdale.lan \
    --to=nivedita@alum.mit.edu \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=gthelen@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=sam@ravnborg.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

all inboxes | Powered by JetHome®