From: Herton R. Krzesinski <[email protected]>
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 <[email protected]>
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 -- [email protected]
To unsubscribe send an email to [email protected]
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/[email protected]
Do not reply to spam, report it:
https://pagure.io/fedora-infrastructure/new_issue