From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: linux-arm-kernel@lists.infradead.org
Cc: "Russell King" <linux@armlinux.org.uk>,
"Nick Terrell" <terrelln@fb.com>, "Arnd Bergmann" <arnd@arndb.de>,
"Tony Lindgren" <tony@atomide.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Sebastian Reichel" <sebastian.reichel@collabora.com>,
"Nick Hawkins" <nick.hawkins@hpe.com>,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Xin Li" <xin3.li@intel.com>,
"Seung-Woo Kim" <sw0312.kim@samsung.com>,
"Paul Bolle" <pebolle@tiscali.nl>,
"Bart Van Assche" <bvanassche@acm.org>,
linux-kernel@vger.kernel.org,
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
"Kees Cook" <keescook@chromium.org>
Subject: [PATCH 3/3] ARM: compressed: Enable ZSTD compression
Date: Wed, 12 Apr 2023 23:21:26 +0200 [thread overview]
Message-ID: <20230412212126.3966502-4-j.neuschaefer@gmx.net> (raw)
In-Reply-To: <20230412212126.3966502-1-j.neuschaefer@gmx.net>
With the previous two commits, it is possible to enable ZSTD
in the decompressor stub for 32-bit ARM.
Unfortunately, ZSTD decompression has been quite slow in my tests
(on ARM926EJ-S, ARMv5T):
- LZO: 7.2 MiB, 6 seconds
- ZSTD: 5.6 MiB, 60 seconds
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---
arch/arm/Kconfig | 1 +
arch/arm/boot/compressed/Makefile | 3 ++-
arch/arm/boot/compressed/decompress.c | 4 ++++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e24a9820e12fa..065a1746a257a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -108,6 +108,7 @@ config ARM
select HAVE_KERNEL_LZMA
select HAVE_KERNEL_LZO
select HAVE_KERNEL_XZ
+ select HAVE_KERNEL_ZSTD
select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M
select HAVE_KRETPROBES if HAVE_KPROBES
select HAVE_MOD_ARCH_SPECIFIC
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index dec565a5b1f21..55bfca154b12a 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -81,6 +81,7 @@ compress-$(CONFIG_KERNEL_LZO) = lzo_with_size
compress-$(CONFIG_KERNEL_LZMA) = lzma_with_size
compress-$(CONFIG_KERNEL_XZ) = xzkern_with_size
compress-$(CONFIG_KERNEL_LZ4) = lz4_with_size
+compress-$(CONFIG_KERNEL_ZSTD) = zstd22_with_size
libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o
@@ -98,7 +99,7 @@ OBJS += lib1funcs.o ashldi3.o bswapsdi2.o
targets := vmlinux vmlinux.lds piggy_data piggy.o \
head.o $(OBJS)
-KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
+KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING -D__DISABLE_EXPORTS
ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \
-I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 3d098b84ee391..2c4fd33444829 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -59,6 +59,10 @@ extern char * strchrnul(const char *, int);
#include "../../../../lib/decompress_unlz4.c"
#endif
+#ifdef CONFIG_KERNEL_ZSTD
+#include "../../../../lib/decompress_unzstd.c"
+#endif
+
int do_decompress(u8 *input, int len, u8 *output, int outlen, void (*error)(char *x))
{
return __decompress(input, len, NULL, NULL, output, outlen, NULL, error);
--
2.39.2
next prev parent reply other threads:[~2023-04-12 21:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 21:21 [PATCH 0/3] ARM ZSTD boot compression Jonathan Neuschäfer
2023-04-12 21:21 ` [PATCH 1/3] ARM: compressed: Pass the actual output length to the decompressor Jonathan Neuschäfer
2023-04-12 21:42 ` Linus Walleij
2023-04-12 21:48 ` Florian Fainelli
2023-04-13 5:20 ` Tony Lindgren
2023-04-15 1:52 ` Jonathan Neuschäfer
2023-04-12 21:21 ` [PATCH 2/3] ARM: compressed: Bump MALLOC_SIZE to 128 KiB Jonathan Neuschäfer
2023-04-12 21:43 ` Linus Walleij
2023-04-12 21:48 ` Florian Fainelli
2023-05-02 8:39 ` Russell King (Oracle)
2023-04-12 21:21 ` Jonathan Neuschäfer [this message]
2023-04-12 21:45 ` [PATCH 3/3] ARM: compressed: Enable ZSTD compression Linus Walleij
2023-04-12 21:49 ` Florian Fainelli
2023-04-12 21:33 ` [PATCH 0/3] ARM ZSTD boot compression Arnd Bergmann
2023-04-13 11:13 ` Arnd Bergmann
2023-04-15 2:00 ` Jonathan Neuschäfer
2023-10-12 22:33 ` Nick Terrell
2023-10-13 1:27 ` J. Neuschäfer
2023-10-20 18:53 ` Nick Terrell
2023-04-14 22:50 ` Jonathan Neuschäfer
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=20230412212126.3966502-4-j.neuschaefer@gmx.net \
--to=j.neuschaefer@gmx.net \
--cc=arnd@arndb.de \
--cc=bvanassche@acm.org \
--cc=christophe.leroy@csgroup.eu \
--cc=f.fainelli@gmail.com \
--cc=geert+renesas@glider.be \
--cc=keescook@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=ndesaulniers@google.com \
--cc=nick.hawkins@hpe.com \
--cc=pebolle@tiscali.nl \
--cc=rmk+kernel@armlinux.org.uk \
--cc=sebastian.reichel@collabora.com \
--cc=sw0312.kim@samsung.com \
--cc=terrelln@fb.com \
--cc=tony@atomide.com \
--cc=xin3.li@intel.com \
/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®