Re: ZSTD compression-level when CONFIG_MODULE_COMPRESS_ZSTD=y

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

 



On Sun, Aug 4, 2024 at 5:30 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
...
> > Which is why, I think it's up-to your distro/builder to choose the
> > policy. Here is what we've been using In Arch `ZSTD_CLEVEL=19 make ...
> > modules_install`.
> >
> > Tl:Dr: You'd want to use `ZSTD_CLEVEL` (or equivalent if using xz)
> > during make modules_install **depending** on the components used and
> > their version.
>
>
> Ah, it is nice.
> I remembered a patch that adds a new CONFIG option to specify the
> compression level,
> but it is possible via ZSTD_CLEVEL.
>
>
> Currently, multithreading (-T0) is always on in scripts/Makefile.modinst,
> but this is questionable to me.
>

I tried with the attached patch and Linux v6.10.3 ...

root# du -s -m /lib/modules/* | sort
103     /lib/modules/6.10-amd64 <--- Debian and XZ compressed modules
103     /lib/modules/6.9.12-amd64
115     /lib/modules/6.10.3-1-amd64-clang18-kcfi <--- with patch
140     /lib/modules/6.10.1-1-amd64-clang18-kcfi <--- without patch
395     /lib/modules/6.1.0-23-amd64

97      /var/cache/apt/archives/linux-image-6.10-amd64_6.10.1-1~exp1_amd64.deb
136     linux-image-6.10.1-1-amd64-clang18-kcfi_6.10.1-1~trixie+dileks1_amd64.deb
111     linux-image-6.10.3-1-amd64-clang18-kcfi_6.10.3-1~trixie+dileks1_amd64.deb
<--- with patch

-Sedat-
From 4ca10368d92ad385934278c9a4364831961e5765 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@xxxxxxxxx>
Date: Sat, 3 Aug 2024 17:39:44 +0200
Subject: [PATCH] kbuild: Use better compress-level for zstd compressed modules

Signed-off-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
---
 scripts/Makefile.modinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 0afd75472679..2a8b37c80cbf 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -146,7 +146,7 @@ quiet_cmd_gzip = GZIP    $@
 quiet_cmd_xz = XZ      $@
       cmd_xz = $(XZ) --check=crc32 --lzma2=dict=1MiB -f $<
 quiet_cmd_zstd = ZSTD    $@
-      cmd_zstd = $(ZSTD) -T0 --rm -f -q $<
+      cmd_zstd = $(ZSTD) -T0 -19 --rm -f -q $<
 
 $(dst)/%.ko.gz: $(dst)/%.ko FORCE
 	$(call cmd,gzip)
-- 
2.45.2


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux