From: Jeremy Linton jlinton@redhat.com
[redhat] configs: Compress kernel with zstd cleanup
Zstd compressed kernels consume less disk space and decompress faster than gziped ones. For example, kernel 6.12rc3 aarch64's on disk size is ~22% smaller and boots ~16% faster on a RPi4. Since this was already on for some x86 flavors, lets propogate the setting to all appropriate architectures and kernel flavors.
Signed-off-by: Jeremy Linton jlinton@redhat.com
diff --git a/redhat/configs/common/generic/CONFIG_KERNEL_GZIP b/redhat/configs/common/generic/CONFIG_KERNEL_GZIP index blahblah..blahblah 100644 --- a/redhat/configs/common/generic/CONFIG_KERNEL_GZIP +++ b/redhat/configs/common/generic/CONFIG_KERNEL_GZIP @@ -1 +1 @@ -CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_GZIP is not set diff --git a/redhat/configs/fedora/generic/CONFIG_KERNEL_UNCOMPRESSED b/redhat/configs/common/generic/CONFIG_KERNEL_UNCOMPRESSED rename from redhat/configs/fedora/generic/CONFIG_KERNEL_UNCOMPRESSED rename to redhat/configs/common/generic/CONFIG_KERNEL_UNCOMPRESSED index blahblah..blahblah 100644 --- a/redhat/configs/fedora/generic/CONFIG_KERNEL_UNCOMPRESSED +++ b/redhat/configs/common/generic/CONFIG_KERNEL_UNCOMPRESSED diff --git a/redhat/configs/common/generic/CONFIG_KERNEL_ZSTD b/redhat/configs/common/generic/CONFIG_KERNEL_ZSTD index blahblah..blahblah 100644 --- a/redhat/configs/common/generic/CONFIG_KERNEL_ZSTD +++ b/redhat/configs/common/generic/CONFIG_KERNEL_ZSTD @@ -1 +1 @@ -# CONFIG_KERNEL_ZSTD is not set +CONFIG_KERNEL_ZSTD=y diff --git a/redhat/configs/common/generic/powerpc/CONFIG_KERNEL_GZIP b/redhat/configs/common/generic/powerpc/CONFIG_KERNEL_GZIP new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/redhat/configs/common/generic/powerpc/CONFIG_KERNEL_GZIP @@ -0,0 +1 @@ +CONFIG_KERNEL_GZIP=y diff --git a/redhat/configs/common/generic/s390x/CONFIG_KERNEL_GZIP b/redhat/configs/common/generic/s390x/CONFIG_KERNEL_GZIP new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/redhat/configs/common/generic/s390x/CONFIG_KERNEL_GZIP @@ -0,0 +1 @@ +CONFIG_KERNEL_GZIP=y diff --git a/redhat/configs/common/generic/s390x/CONFIG_KERNEL_ZSTD b/redhat/configs/common/generic/s390x/CONFIG_KERNEL_ZSTD new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/redhat/configs/common/generic/s390x/CONFIG_KERNEL_ZSTD @@ -0,0 +1 @@ +# CONFIG_KERNEL_ZSTD is not set diff --git a/redhat/configs/fedora/generic/x86/CONFIG_KERNEL_GZIP b/redhat/configs/fedora/generic/x86/CONFIG_KERNEL_GZIP deleted file mode 100644 index blahblah..blahblah 0 --- a/redhat/configs/fedora/generic/x86/CONFIG_KERNEL_GZIP +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_KERNEL_GZIP is not set diff --git a/redhat/configs/fedora/generic/x86/CONFIG_KERNEL_ZSTD b/redhat/configs/fedora/generic/x86/CONFIG_KERNEL_ZSTD deleted file mode 100644 index blahblah..blahblah 0 --- a/redhat/configs/fedora/generic/x86/CONFIG_KERNEL_ZSTD +++ /dev/null @@ -1 +0,0 @@ -CONFIG_KERNEL_ZSTD=y diff --git a/redhat/configs/rhel/generic/s390x/CONFIG_KERNEL_UNCOMPRESSED b/redhat/configs/rhel/generic/s390x/CONFIG_KERNEL_UNCOMPRESSED deleted file mode 100644 index blahblah..blahblah 0 --- a/redhat/configs/rhel/generic/s390x/CONFIG_KERNEL_UNCOMPRESSED +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_KERNEL_UNCOMPRESSED is not set diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -673,6 +673,8 @@ Provides: installonlypkg(kernel) # BuildRequires: kmod, bash, coreutils, tar, git-core, which BuildRequires: bzip2, xz, findutils, m4, perl-interpreter, perl-Carp, perl-devel, perl-generators, make, diffutils, gawk, %compression +# Kernel EFI/Compression set by CONFIG_KERNEL_ZSTD +BuildRequires: zstd BuildRequires: gcc, binutils, redhat-rpm-config, hmaccalc, bison, flex, gcc-c++ %if 0%{?fedora} BuildRequires: rust, rust-src, bindgen
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2198138...
The description could be a little more detailed, since this isn't just a cleanup. What arches are appropriate?
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2198148...
So for ppc and s390 we have both GZIP and ZSTD enabled, and rely on Kconfig to choose the _right_ one. ``` $ make dist-configs-prep $ grep -e "KERNEL_ZSTD" -e "KERNEL_GZIP" /home/src/kernel/kernel- ark/redhat/configs/kernel-ppc64le-fedora.config CONFIG_KERNEL_GZIP=y CONFIG_KERNEL_ZSTD=y
```
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2198148...
Is that requirement for all arches?
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2204112...
All EFI arches, I'm not entirely sure about ppc/s390 since I guess its dependent on their bootloader.
So, for fedora/centos/rhel I guess that would be aarch64/amd64/riscv at this point.
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2204116...
No, only ones where its enabled :) Although I went back and forth on whether to make it dependent on EFI, but I frankly don't know what the !efi arches are capable of in their bootloaders.
So, suggestion welcome.
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2205637...
How about `%ifarch x86_64 aarch64 riscv64`?
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2211531...
Ok, I compared the pre-kconfig processed config files and they look 'cleaner' now everywhere as there aren't conflicts anymore between the compression mode (or UNCOMPRESSED). The s390 and ppc64 configs either remain unchanged or are explicit about the compression mode. EFI arches are now explicitly changing from gzip to zstd.
I've also used the ifdef arch selection in the specfile. The commit message doesn't call this a cleanup anymore even though it 'sync's behavior across all the distro flavors.
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2211532...
I've applied this.
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2211533...
This situation where the intermediate configs have conflicting settings should now be resolved across all the config files.
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2211535...
Commit message is updated to suggest that EFI arches are the ones being changed to zstd, cleanup comments mostly removed.
From: pbrobinson on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2212800...
@dhorak1 can you confirm/clarify whether ppc/s390 can use zstd compression?
From: Dan Horák on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2213179...
I think that s390x can do zstd, but powerpc can't, but I am checking with IBM now.
From: pbrobinson on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2213306...
Does powerpc use grub2? Because if so it maybe grub2 handles the zstd for powerpc?
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2223290...
That is just a rebase to the latest os-build
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2229168...
So, its not possible to turn this on with PPC at the moment without upstream kernel changes. S390x is a different story, and the zstd builds do work (at least in qemu), but when tracking back the commit which enables it there was a comment that they are slower on real HW (z15+) because its providing a hardware zlib decompressor. So, it is a case of slower decompression to save a few percent disk space, which I guess probably isn't a good tradeoff on that platform.
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2237073...
I'm going to mark this resolved because this commit is not changing ppc64le/s390x's compression mode, and from what I understand at the moment that is the correct choice. If either of those SIGs feels the need to change that, then it can be done separately.
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2237135...
Have you had a chance to try kdump?
From: Jeremy Linton on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3460#note_2237233...
Well, that's going to be a problem I should have forseen given I hacked some of the kexec/zboot stuff a year back.
So, yes, this should probably be on hold until kexec can decompress these because checking the code right now it can only do lzma/gzip AFAIK.
kernel@lists.fedoraproject.org