[OS-BUILD PATCHv2 2/2] redhat/configs: enable in kernel compression/decompression of compressed modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Herton R. Krzesinski <herton@xxxxxxxxxx>

redhat/configs: enable in kernel compression/decompression of compressed modules

Our packaging for some time has shipped modules compressed with xz.
These are decompressed by modprobe/kmod on userspace, then provided to the
kernel.

However, the kernel for some time now supports in-kernel decompression since
the change b1ae6dc41eaa ("module: add in-kernel support for decompressing").
Doing in kernel decompression is better as pointed out by Andrew Zaborowski in
RHEL-79278: it allows kmod to use the finit_module() syscall, which allows the
kernel to better detect concurrent loading of modules preventing spikes in usage
of memory/vmalloc memory. The prevention of memory spikes/usage in concurrent
module loading was handled by Linus in commit 9b9879fc0327 ("modules: catch
concurrent module loads, treat them as idempotent"). But we are not able to take
advantage of this fix if we don't have in kernel decompression of modules enabled,
since kmod will not use finit_module() as the module is compressed and it
fallbacks to init_module().

Thus, make sure we enable in-kernel decompression of modules, which requires to
enable MODULE_COMPRESS: the key here is to keep MODULE_COMPRESS_ALL disabled,
which allows us to keep our current build infra-structure/spec file untouched,
since we build and compress the modules by ourselves and in the proper order
required due module signing. At the same time, it should allow external modules
to continue to be built without interference of enabling compress/decompress.

Signed-off-by: Herton R. Krzesinski <herton@xxxxxxxxxx>

diff --git a/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS b/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS
index blahblah..blahblah 100644
--- a/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS
+++ b/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS
@@ -1 +1 @@
-# CONFIG_MODULE_COMPRESS is not set
+CONFIG_MODULE_COMPRESS=y
diff --git a/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_ALL b/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_ALL
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_ALL
@@ -0,0 +1 @@
+# CONFIG_MODULE_COMPRESS_ALL is not set
diff --git a/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_NONE b/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_NONE
deleted file mode 100644
index blahblah..blahblah 0
--- a/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_NONE
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_MODULE_COMPRESS_NONE=y
diff --git a/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_XZ b/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_XZ
index blahblah..blahblah 100644
--- a/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_XZ
+++ b/redhat/configs/common/generic/CONFIG_MODULE_COMPRESS_XZ
@@ -1 +1 @@
-# CONFIG_MODULE_COMPRESS_XZ is not set
+CONFIG_MODULE_COMPRESS_XZ=y
diff --git a/redhat/configs/common/generic/CONFIG_MODULE_DECOMPRESS b/redhat/configs/common/generic/CONFIG_MODULE_DECOMPRESS
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/configs/common/generic/CONFIG_MODULE_DECOMPRESS
@@ -0,0 +1 @@
+CONFIG_MODULE_DECOMPRESS=y

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3700

-- 
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux