Re: [PATCH] s390/boot: add zstd support

From: Vasily Gorbik
Date: Tue Jun 15 2021 - 19:20:07 EST


On Tue, Jun 15, 2021 at 12:41:50PM +0100, Dimitri John Ledkov wrote:
> Enable ztsd support in s390/boot, to enable booting with zstd
> compressed kernel when configured with CONFIG_KERNEL_ZSTD=y.
>
> BugLink: https://bugs.launchpad.net/bugs/1931725
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@xxxxxxxxxxxxx>
> cc: Heiko Carstens <hca@xxxxxxxxxxxxx>
> cc: Vasily Gorbik <gor@xxxxxxxxxxxxx>
> cc: Christian Borntraeger <borntraeger@xxxxxxxxxx>
> cc: linux-s390@xxxxxxxxxxxxxxx
> ---
> arch/s390/Kconfig | 1 +
> arch/s390/boot/compressed/Makefile | 4 ++++
> arch/s390/boot/compressed/decompressor.c | 4 ++++
> 3 files changed, 9 insertions(+)

Reviewing your patch I noticed that we use wrong condition to
define BOOT_HEAP_SIZE. So I made a tiny fix:

diff --git a/arch/s390/boot/compressed/decompressor.c b/arch/s390/boot/compressed/decompressor.c
index 3061b11c4d27..cf2571050c68 100644
--- a/arch/s390/boot/compressed/decompressor.c
+++ b/arch/s390/boot/compressed/decompressor.c
@@ -29,5 +29,5 @@ extern unsigned char _compressed_start[];
extern unsigned char _compressed_end[];

-#ifdef CONFIG_HAVE_KERNEL_BZIP2
+#ifdef CONFIG_KERNEL_BZIP2
#define BOOT_HEAP_SIZE 0x400000
#else

And applied your patch with the following changes:
Added to the commit message:
"""
BOOT_HEAP_SIZE is defined to 0x30000 in this case. Actual decompressor
memory usage with allyesconfig is currently 0x26150.
"""

diff --git a/arch/s390/boot/compressed/decompressor.c b/arch/s390/boot/compressed/decompressor.c
index cf2571050c68..37a4a8d33c6c 100644
--- a/arch/s390/boot/compressed/decompressor.c
+++ b/arch/s390/boot/compressed/decompressor.c
@@ -31,4 +31,6 @@ extern unsigned char _compressed_end[];
#ifdef CONFIG_KERNEL_BZIP2
#define BOOT_HEAP_SIZE 0x400000
+#elif CONFIG_KERNEL_ZSTD
+#define BOOT_HEAP_SIZE 0x30000
#else
#define BOOT_HEAP_SIZE 0x10000

I hope you are ok with that, thanks!