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

ZSTD compressed kernel. #297

Open
cedws opened this issue Nov 22, 2018 · 13 comments
Open

ZSTD compressed kernel. #297

cedws opened this issue Nov 22, 2018 · 13 comments

Comments

@cedws
Copy link

cedws commented Nov 22, 2018

Is your feature request related to a problem? Please describe.
No problem.

Describe the solution you'd like
As far as I can tell, the initrd is currently XZ compressed. I checked this by mounting the boot partition of clear-26430-live.img, navigating to /EFI/org.clearlinux/, and running binwalk kernel-org.clearlinux.native.4.19.2-662 (I think this is the initrd...), which displayed:

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             Microsoft executable, portable (PE)
17841         0x45B1          xz compressed data
7703056       0x758A10        xz compressed data
7704684       0x75906C        Unix path: /arch/x86/boot/compressed/kaslr_64.c!?

Instead, it could be compressed with ZSTD to yield faster boot times.

Describe alternatives you've considered
I think ZSTD was only recently supported, so LZ4 is an alternative compression option.

Additional context
None.

@bryteise
Copy link
Member

That's the kernel, generally our installations/images don't use an initrd unless required (encrypted rootfs for instance).

@cedws
Copy link
Author

cedws commented Nov 22, 2018

Ah okay, I thought having an initrd was universal. Since this is compressed with XZ, can other algorithms be used? I had a look and found this relevant patch for ZSTD support.

@bryteise
Copy link
Member

@thiagomacieira has looked at using zstd more in the distro I think, any thoughts here?

@cedws cedws changed the title ZSTD compressed initrd. ZSTD compressed kernel. Nov 22, 2018
@fenrus75
Copy link
Contributor

fenrus75 commented Nov 22, 2018 via email

@thiagomacieira
Copy link

We should benchmark it. Zstd does decompress faster which could help in our objectives for fast boot times. It does compress less than Xz, but given the file sizes in question, it shouldn't affect regular SSDs.

Slow devices (eMMC and SD cards) may want to opt to Xz to minimise I/O.

@ms178
Copy link

ms178 commented Dec 10, 2018

FYI, the relevant kernel patch series was revised one month ago: http://lkml.iu.edu/hypermail/linux/kernel/1811.1/02341.html

@puneetse
Copy link
Contributor

Just adding a marker here that the ZSTD patch hasn't been merged upstream yet.

@romulasry
Copy link

Update?

@romulasry
Copy link

@romulasry
Copy link

@romulasry
Copy link

Now That The Linux Kernel Can Be Zstd-Compressed, The Next Step Is The Firmware
https://www.phoronix.com/scan.php?page=news_item&px=Zstd-Firmware-Compress-Patch

@romulasry
Copy link

With Linux 5.9 comes the ability to compress the Linux kernel image / initrd with Zstd
https://phoronix.com/scan.php?page=news_item&px=Linux-Zstd-Compression-Close

Source: https://www.phoronix.com/scan.php?page=news_item&px=Zstd-Firmware-Compress-Patch

@romulasry
Copy link

Now that it is updated, it just needs to be compressed with zstd. Great job.

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

8 participants