mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mingcong Bai <jeffbai@aosc.io>
To: Ard Biesheuvel <ardb@kernel.org>, linux-kernel@vger.kernel.org
Cc: "Kexy Biscuit" <kexybiscuit@aosc.io>,
	"Xi Ruoyao" <xry111@xry111.site>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>,
	"Nick Terrell" <terrelln@fb.com>,
	"David Sterba" <dsterba@suse.com>,
	"Jan Stancek" <jstancek@redhat.com>,
	"Josh Poimboeuf" <jpoimboe@kernel.org>,
	"Petr Mladek" <pmladek@suse.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Simon Glass" <sjg@chromium.org>,
	"Marco Elver" <elver@google.com>,
	linux-kbuild@vger.kernel.org
Subject: Re: [RFC PATCH] x86/boot: use zstd -19 if building for 32-bit
Date: Wed, 29 Jul 2026 09:44:50 +0800	[thread overview]
Message-ID: <ca5671ba-21f7-4cdd-8a1f-d0b4fd310789@aosc.io> (raw)
In-Reply-To: <f833d263-9f47-454e-bc64-818ac42d63dd@app.fastmail.com>

Hi Ard,

在 2026/7/28 23:58, Ard Biesheuvel 写道:
> 
> 
> On Tue, 28 Jul 2026, at 17:31, Mingcong Bai wrote:
>> When using native build environments (that is, 32-bit x86 chroot/container
>> as build environment for 32-bit x86 binaries), `zstd -22' requests more
>> virtual memory than that could be allowed on 32-bit hosts.
>>
>> Introduce `cmd_zstd_with_size' for CONFIG_X86_32 builds.
>>
>> This is quite possibly just stupid... But there doesn't seem to be a way
>> to detect the host environment. So I'm sending this patch as a means to
>> ask for your opinions.
>>
>> Any help would be greated appreciated.
>>
>> Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
>> ---
>>   arch/x86/boot/compressed/Makefile | 5 +++++
>>   scripts/Makefile.lib              | 3 +++
>>   2 files changed, 8 insertions(+)
>>
> 
> Doesn't this mean ZSTD -22 is generally broken on 32-bit? How is this
> specific to the kernel?
It's not (and remains unresolved)[1] - as I mentioned in the email, I 
sent this patch out as a means to spark some discussion on how to 
approach this problem.

Nick Terrel mentioned in commit 48f7ddf785af ("init: Add support for 
zstd compressed kernel") that "zstd22 is used for kernel compression 
because it is decompressed in a single pass, so zstd doesn't need to 
allocate a window buffer." But I wonder if it resulted in tangible 
change in compression ratio - but I can do more testing.

[1]: https://github.com/facebook/zstd/issues/1964

Best Regards,
Mingcong Bai

  reply	other threads:[~2026-07-29  1:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 14:31 Mingcong Bai
2026-07-28 14:42 ` Xi Ruoyao
2026-07-28 15:58 ` Ard Biesheuvel
2026-07-29  1:44   ` Mingcong Bai [this message]
2026-07-28 16:05 ` H. Peter Anvin

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=ca5671ba-21f7-4cdd-8a1f-d0b4fd310789@aosc.io \
    --to=jeffbai@aosc.io \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dsterba@suse.com \
    --cc=elver@google.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=jstancek@redhat.com \
    --cc=kexybiscuit@aosc.io \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=sjg@chromium.org \
    --cc=terrelln@fb.com \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xry111@xry111.site \
    /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®