mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: torvic9@mailbox.org
To: "linux-kbuild@vger.kernel.org" <linux-kbuild@vger.kernel.org>,
	"masahiroy@kernel.org" <masahiroy@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Piotr Górski" <lucjan.lucjanov@gmail.com>
Subject: [PATCH 1/2] kbuild: allow setting zstd compression level for modules
Date: Fri, 9 Apr 2021 15:28:23 +0200 (CEST)	[thread overview]
Message-ID: <1557177615.69331.1617974903770@office.mailbox.org> (raw)

Zstd offers a very fine-grained control of compression ratios.
Add a Kconfig option that allows setting the desired compression
level for module compression.

Based on Masahiro's linux-kbuild.

Signed-off-by: Tor Vic <torvic9@mailbox.org>
Tested-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
---
 init/Kconfig             | 8 ++++++++
 scripts/Makefile.modinst | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index b5744d32c..15bb02c24 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2275,6 +2275,14 @@ config MODULE_COMPRESS_ZSTD
 
 endchoice
 
+config MODULE_COMPRESS_ZSTD_LEVEL
+    int "Compression level (1-19)"
+    depends on MODULE_COMPRESS_ZSTD
+    range 1 19
+    default 3
+    help
+        Compression level used by zstd for compressing modules.
+
 config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
 	bool "Allow loading of modules with missing namespace imports"
 	help
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index ff9b09e4c..0a0db2278 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -97,7 +97,7 @@ quiet_cmd_gzip = GZIP    $@
 quiet_cmd_xz = XZ      $@
       cmd_xz = $(XZ) --lzma2=dict=2MiB -f $<
 quiet_cmd_zstd = ZSTD    $@
-      cmd_zstd = $(ZSTD) -T0 --rm -f -q $<
+      cmd_zstd = $(ZSTD) -$(CONFIG_MODULE_COMPRESS_ZSTD_LEVEL) -T0 --rm -f -q $<
 
 $(dst)/%.ko.gz: $(dst)/%.ko FORCE
 	$(call cmd,gzip)
-- 
2.31.1

             reply	other threads:[~2021-04-09 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 13:28 torvic9 [this message]
2021-04-09 13:31 ` [PATCH 2/2] kbuild: allow setting zstd compression level for kernel torvic9

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557177615.69331.1617974903770@office.mailbox.org \
    --to=torvic9@mailbox.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucjan.lucjanov@gmail.com \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®