* [PATCH] Makefile: use smaller dictionary size for xz module compression
@ 2020-12-16 12:58 torvic9
2020-12-21 11:17 ` Masahiro Yamada
0 siblings, 1 reply; 2+ messages in thread
From: torvic9 @ 2020-12-16 12:58 UTC (permalink / raw)
To: masahiroy, linux-kbuild
By default, xz without parameters uses a dictionary size of 8 MB.
However, most modules are much smaller than that.
The xz manpage states that 'increasing dictionary size usually improves
compression ratio, but a dictionary bigger than the uncompressed file
is waste of memory'.
Use a dictionary size of 2 MB for module compression, resulting in
slightly higher compression speed while still maintaining a good
compression ratio.
Signed-off-by: Tor Vic <torvic9@mailbox.org>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 076d4e6b9..f9a6d0a4d 100644
--- a/Makefile
+++ b/Makefile
@@ -1058,7 +1058,7 @@ ifdef CONFIG_MODULE_COMPRESS
mod_compress_cmd = $(KGZIP) -n -f
endif # CONFIG_MODULE_COMPRESS_GZIP
ifdef CONFIG_MODULE_COMPRESS_XZ
- mod_compress_cmd = $(XZ) -f
+ mod_compress_cmd = $(XZ) --lzma2=dict=2MiB -f
endif # CONFIG_MODULE_COMPRESS_XZ
endif # CONFIG_MODULE_COMPRESS
export mod_compress_cmd
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Makefile: use smaller dictionary size for xz module compression
2020-12-16 12:58 [PATCH] Makefile: use smaller dictionary size for xz module compression torvic9
@ 2020-12-21 11:17 ` Masahiro Yamada
0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2020-12-21 11:17 UTC (permalink / raw)
To: torvic9; +Cc: linux-kbuild
On Wed, Dec 16, 2020 at 9:59 PM <torvic9@mailbox.org> wrote:
>
> By default, xz without parameters uses a dictionary size of 8 MB.
> However, most modules are much smaller than that.
> The xz manpage states that 'increasing dictionary size usually improves
> compression ratio, but a dictionary bigger than the uncompressed file
> is waste of memory'.
> Use a dictionary size of 2 MB for module compression, resulting in
> slightly higher compression speed while still maintaining a good
> compression ratio.
>
> Signed-off-by: Tor Vic <torvic9@mailbox.org>
> ---
Applied to linux-kbuild. Thanks.
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 076d4e6b9..f9a6d0a4d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1058,7 +1058,7 @@ ifdef CONFIG_MODULE_COMPRESS
> mod_compress_cmd = $(KGZIP) -n -f
> endif # CONFIG_MODULE_COMPRESS_GZIP
> ifdef CONFIG_MODULE_COMPRESS_XZ
> - mod_compress_cmd = $(XZ) -f
> + mod_compress_cmd = $(XZ) --lzma2=dict=2MiB -f
> endif # CONFIG_MODULE_COMPRESS_XZ
> endif # CONFIG_MODULE_COMPRESS
> export mod_compress_cmd
> --
> 2.29.2
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-21 11:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 12:58 [PATCH] Makefile: use smaller dictionary size for xz module compression torvic9
2020-12-21 11:17 ` Masahiro Yamada
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.