Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10-build-initramfs: xz --threads=0 doesn't use more than one thread at -8 #48

Closed
akorn opened this issue Feb 7, 2018 · 1 comment
Closed

Comments

@akorn
Copy link
Contributor

akorn commented Feb 7, 2018

How many threads are used also depends on the compression level. At -6, I've seen it use 3-4 threads, which speeds up initramfs compression a lot. With -8, it always only uses one thread (although maybe it also depends on the amount of data being compressed; I don't know).

I suggest that the -8 in /etc/grml/fai/config/files/etc/initramfs-tools/conf.d/xz-compress/GRMLBASE be replaced with -6.

@mika
Copy link
Member

mika commented Apr 1, 2020

Finally managed to care of this, thanks!

clexanis pushed a commit to clexanis/grml-build that referenced this issue Dec 12, 2022
Quoting from the bug report:

| How many threads are used also depends on the compression level. At -6,
| I've seen it use 3-4 threads, which speeds up initramfs compression a lot.
| With -8, it always only uses one thread (although maybe it also depends on
| the amount of data being compressed; I don't know).

The default compression preset level is -6, so there's no need to specify
it.

This also matches the behavior of initramfs-tools >=0.119:

| commit cf9691da3847a6bfadb4a5c9e0f6213bd7d10fdc
| Author: Ben Hutchings <ben@decadent.org.uk>
| Date:   Thu Oct 16 15:34:54 2014 +0200
|
|     mkinitramfs: Use default xz compression level rather than -8
|
|     xz -8 wants 370 MB VM for compression, but Debian tries to support
|     systems with less physical memory than that.
|
|     The benchmark results given in commit bedf1e3c0882 ('Use -8 for
|     compression with xz.') show only a 1% increase in size when changing
|     to -6, but VM usage will be reduced by 75%.
|
|     Closes: #697335
|     Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
| diff --git mkinitramfs mkinitramfs
| index 07190ed..25932c1 100755
| --- mkinitramfs
| +++ mkinitramfs
| @@ -146,7 +146,7 @@ if dpkg --compare-versions "${version}" lt "2.6.38" 2>/dev/null; then
|  fi
|
|  [ "${compress}" = lzop ] && compress="lzop -9"
| -[ "${compress}" = xz ] && compress="xz -8 --check=crc32"
| +[ "${compress}" = xz ] && compress="xz --check=crc32"
|
|  if [ -d "${outfile}" ]; then
|         echo "${outfile} is a directory" >&2

Let's keep the xz wrapper though, to force its usage independent of the
initramfs-tools version being used and have it available, if we decide to
add further custom options in the future.

Thanks: Dr. András Korn
Closes: grml#48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants