Re: [PATCH v4 0/9] Update to zstd-1.4.6

2020-10-02 Thread Chris Mason

On 2 Oct 2020, at 2:54, Christoph Hellwig wrote:


On Wed, Sep 30, 2020 at 08:05:45PM +, Nick Terrell wrote:



On Sep 29, 2020, at 11:53 PM, Christoph Hellwig  
wrote:


As you keep resend this I keep retelling you that should not do it.
Please provide a proper Linux API, and switch to that.  Versioned 
APIs

have absolutely no business in the Linux kernel.


The API is not versioned. We provide a stable ABI for a large section 
of our API,
and the parts that aren???t ABI stable don???t change in semantics, 
and undergo long

deprecation periods before being removed.

The change of callers is a one-time change to transition from the 
existing API

in the kernel, which was never upstream's API, to upstream's API.


Again, please transition it to a sane kernel API.  We don't have an
"upstream" in this case.


The upstream is the zstd project where all this code originates, and 
where the active development takes place.  As Eric Biggers pointed out, 
it also receives a lot of Q/A separate from the kernel.  I think we gain 
a great deal by leveraging the testing and documentation of the zstd 
project in the kernel interfaces we use.


We lose some consistency with the kernel coding style, but we gain the 
ability to search for docs, issues, and fixes directly against the zstd 
project and git repo.


-chris


Re: [GIT PULL][PATCH v4 0/9] Update to zstd-1.4.6

2020-10-02 Thread Christoph Hellwig
On Thu, Oct 01, 2020 at 06:35:34PM +, Nick Terrell wrote:
> I???m open to suggestions on how to get a zstd update done better. I don???t
> know of any way to break this patch up into smaller patches that all compile.
> The code is all generated directly from upstream and modified to work in the
> kernel by automated scripts.

Documentation/process/submitting-patches.rst:


"Separate your changes
-

Separate each **logical change** into a separate patch.

For example, if your changes include both bug fixes and performance
enhancements for a single driver, separate those changes into two
or more patches.  If your changes include an API update, and a new
driver which uses that new API, separate those into two patches."

It's not that hard, is it?  Please do your very basic homework instead
of pretending to be a special snowflake and then come back.



Re: [PATCH v4 0/9] Update to zstd-1.4.6

2020-10-02 Thread Christoph Hellwig
On Wed, Sep 30, 2020 at 08:05:45PM +, Nick Terrell wrote:
> 
> 
> > On Sep 29, 2020, at 11:53 PM, Christoph Hellwig  wrote:
> > 
> > As you keep resend this I keep retelling you that should not do it.
> > Please provide a proper Linux API, and switch to that.  Versioned APIs
> > have absolutely no business in the Linux kernel.
> 
> The API is not versioned. We provide a stable ABI for a large section of our 
> API,
> and the parts that aren???t ABI stable don???t change in semantics, and 
> undergo long
> deprecation periods before being removed.
> 
> The change of callers is a one-time change to transition from the existing API
> in the kernel, which was never upstream's API, to upstream's API.

Again, please transition it to a sane kernel API.  We don't have an
"upstream" in this case.


Re: [GIT PULL][PATCH v4 0/9] Update to zstd-1.4.6

2020-10-01 Thread Nick Terrell


> On Oct 1, 2020, at 3:18 AM, David Sterba  wrote:
> 
> On Wed, Sep 30, 2020 at 08:49:49PM +, Nick Terrell wrote:
>>> On Sep 29, 2020, at 11:53 PM, Nick Terrell  wrote:
>>> 
>>> From: Nick Terrell 
>> 
>> It has been brought to my attention that patch 3 hasn’t made it to patchwork,
>> likely because it is too large. I’ll include a pull request in the next 
>> cover letter,
>> together with the patches (if needed).
> 
> The patch 3/9 saved to a file is 1.6M, over 35000 lines, the diffstat
> says:
> 
> 66 files changed, 24268 insertions(+), 12889 deletions(-)
> 
> Seriously, this is wrong in so many ways. There's the rationale for
> one-time change etc, but the actual result is beyond what I would accept
> and would not encourage anyone to merge as-is.

I’m open to suggestions on how to get a zstd update done better. I don’t
know of any way to break this patch up into smaller patches that all compile.
The code is all generated directly from upstream and modified to work in the
kernel by automated scripts.

I think the benefits of updating zstd are pretty clear: bug fixes, 3 years of 
testing,
features, debuggability, support from zstd upstream, and significant performance
improvements.

So I hope we can come up with a way forward to get this merged.

This large of a patch is a one-time change. But, the zstd updates in general
will be large, containing 100s of commits worth of changes (as opposed to
~3500 and a structure change in this diff). E.g. the upstream diff between
two upstream versions range from 50KB - 500KB. Zstd is an actively
maintained project, so there is going to be churn when consuming it. But it
also means that we’re actively supporting the project if any problems occur.

My view is that kernel developers don’t need to review upstreams zstd’s code. We
should focus on the diff from upstream, and ensuring that everything works in 
the
kernel environment. The imported code from upstream zstd is ~30K LOC, which is
too large for anyone to reasonably review.

As mentioned in the patch, this commit shows the diff from upstream zstd, which
is much more manageable:

https://github.com/terrelln/linux/commit/467c9ea1df1100db48c020c3c8b282a2a30f5116

I’ve generated it by importing upstream zstd as-is into the kernel file 
structure. Then
running the automation to generate the kernel patch from upstream and importing
it into the kernel on top of the upstream patch.

Best,
Nick

Re: [GIT PULL][PATCH v4 0/9] Update to zstd-1.4.6

2020-10-01 Thread David Sterba
On Wed, Sep 30, 2020 at 08:49:49PM +, Nick Terrell wrote:
> > On Sep 29, 2020, at 11:53 PM, Nick Terrell  wrote:
> > 
> > From: Nick Terrell 
> 
> It has been brought to my attention that patch 3 hasn’t made it to patchwork,
> likely because it is too large. I’ll include a pull request in the next cover 
> letter,
> together with the patches (if needed).

The patch 3/9 saved to a file is 1.6M, over 35000 lines, the diffstat
says:

 66 files changed, 24268 insertions(+), 12889 deletions(-)

Seriously, this is wrong in so many ways. There's the rationale for
one-time change etc, but the actual result is beyond what I would accept
and would not encourage anyone to merge as-is.


Re: [GIT PULL][PATCH v4 0/9] Update to zstd-1.4.6

2020-09-30 Thread Nick Terrell
> On Sep 29, 2020, at 11:53 PM, Nick Terrell  wrote:
> 
> From: Nick Terrell 

It has been brought to my attention that patch 3 hasn’t made it to patchwork,
likely because it is too large. I’ll include a pull request in the next cover 
letter,
together with the patches (if needed).

Please pull from

 g...@github.com:terrelln/linux.git tags/v4-zstd-1.4.6

to get these changes.

> This patchset upgrades the zstd library to the latest upstream release. The
> current zstd version in the kernel is a modified version of upstream 
> zstd-1.3.1.
> At the time it was integrated, zstd wasn't ready to be used in the kernel 
> as-is.
> But, it is now possible to use upstream zstd directly in the kernel.
> 
> I have not yet release zstd-1.4.6 upstream. I want the zstd version in the 
> kernel
> to match up with a known upstream release, so we know exactly what code is
> running. Whenever this patchset is ready for merge, I will cut a release at 
> the
> upstream commit that gets merged. This should not be necessary for future
> releases.
> 
> The kernel zstd library is automatically generated from upstream zstd. A 
> script
> makes the necessary changes and imports it into the kernel. The changes are:
> 
> 1. Replace all libc dependencies with kernel replacements and rewrite 
> includes.
> 2. Remove unncessary portability macros like: #if defined(_MSC_VER).
> 3. Use the kernel xxhash instead of bundling it.
> 
> This automation gets tested every commit by upstream's continuous integration.
> When we cut a new zstd release, we will submit a patch to the kernel to update
> the zstd version in the kernel.
> 
> I've updated zstd to upstream with one big patch because every commit must 
> build,
> so that precludes partial updates. Since the commit is 100% generated, I hope 
> the
> review burden is lightened. I considered replaying upstream commits, but that 
> is
> not possible because there have been ~3500 upstream commits since the last 
> zstd
> import, and the commits don't all build individually. The bulk update 
> preserves
> bisectablity because bugs can be bisected to the zstd version update. At that
> point the update can be reverted, and we can work with upstream to find and 
> fix
> the bug. After this big switch in how the kernel consumes zstd, future patches
> will be smaller, because they will only have one upstream release worth of
> changes each.
> 
> This patchset changes the zstd API from a custom kernel API to the upstream 
> API.
> I considered wrapping the upstream API with a wrapper that is closer to the
> kernel style guide. Following advise from https://lkml.org/lkml/2020/9/17/814
> I've chosen to use the upstream API directly, to minimize opportunities to
> introduce bugs, and because using the upstream API directly makes debugging 
> and
> communication with upstream easier.
> 
> This patchset comes in 3 parts:
> 1. The first 2 patches prepare for the zstd upgrade. The first patch adds a
>   compatibility wrapper so zstd can be upgraded without modifying any callers.
>   The second patch adds an indirection for the lib/decompress_unzstd.c 
> including
>   of all decompression source files.
> 2. Import zstd-1.4.6. This patch is completely generated from upstream using
>   automated tooling.
> 3. Update all callers to the zstd-1.4.6 API then delete the compatibility
>   wrapper.
> 
> I tested every caller of zstd on x86_64. I tested both after the 1.4.6 upgrade
> using the compatibility wrapper, and after the final patch in this series. 
> 
> I tested kernel and initramfs decompression in i386 and arm.
> 
> I ran benchmarks to compare the current zstd in the kernel with zstd-1.4.6.
> I benchmarked on x86_64 using QEMU with KVM enabled on an Intel i9-9900k.
> I found:
> * BtrFS zstd compression at levels 1 and 3 is 5% faster
> * BtrFS zstd decompression+read is 15% faster
> * SquashFS zstd decompression+read is 15% faster
> * F2FS zstd compression+write at level 3 is 8% faster
> * F2FS zstd decompression+read is 20% faster
> * ZRAM decompression+read is 30% faster
> * Kernel zstd decompression is 35% faster
> * Initramfs zstd decompression+build is 5% faster
> 
> The latest zstd also offers bug fixes and a 1 KB reduction in stack uage 
> during
> compression. For example the recent problem with large kernel decompression 
> has
> been fixed upstream for over 2 years https://lkml.org/lkml/2020/9/29/27.
> 
> Please let me know if there is anything that I can do to ease the way for 
> these
> patches. I think it is important because it gets large performance 
> improvements,
> contains bug fixes, and is switching to a more maintainable model of consuming
> upstream zstd directly, making it easy to keep up to date.
> 
> Best,
> Nick Terrell
> 
> v1 -> v2:
> * Successfully tested F2FS with help from Chao Yu to fix my test.
> * (1/9) Fix ZSTD_initCStream() wrapper to handle pledged_src_size=0 means 
> unknown.
>  This fixes F2FS with the zstd-1.4.6 compatibility wrapper, exposed by the 
> test.
> 
> v2 

Re: [PATCH v4 0/9] Update to zstd-1.4.6

2020-09-30 Thread Nick Terrell


> On Sep 29, 2020, at 11:53 PM, Christoph Hellwig  wrote:
> 
> As you keep resend this I keep retelling you that should not do it.
> Please provide a proper Linux API, and switch to that.  Versioned APIs
> have absolutely no business in the Linux kernel.

The API is not versioned. We provide a stable ABI for a large section of our 
API,
and the parts that aren’t ABI stable don’t change in semantics, and undergo long
deprecation periods before being removed.

The change of callers is a one-time change to transition from the existing API
in the kernel, which was never upstream's API, to upstream's API.

-Nick

> On Tue, Sep 29, 2020 at 11:53:09PM -0700, Nick Terrell wrote:
>> From: Nick Terrell 
>> 
>> This patchset upgrades the zstd library to the latest upstream release. The
>> current zstd version in the kernel is a modified version of upstream 
>> zstd-1.3.1.
>> At the time it was integrated, zstd wasn't ready to be used in the kernel 
>> as-is.
>> But, it is now possible to use upstream zstd directly in the kernel.
>> 
>> I have not yet release zstd-1.4.6 upstream. I want the zstd version in the 
>> kernel
>> to match up with a known upstream release, so we know exactly what code is
>> running. Whenever this patchset is ready for merge, I will cut a release at 
>> the
>> upstream commit that gets merged. This should not be necessary for future
>> releases.
>> 
>> The kernel zstd library is automatically generated from upstream zstd. A 
>> script
>> makes the necessary changes and imports it into the kernel. The changes are:
>> 
>> 1. Replace all libc dependencies with kernel replacements and rewrite 
>> includes.
>> 2. Remove unncessary portability macros like: #if defined(_MSC_VER).
>> 3. Use the kernel xxhash instead of bundling it.
>> 
>> This automation gets tested every commit by upstream's continuous 
>> integration.
>> When we cut a new zstd release, we will submit a patch to the kernel to 
>> update
>> the zstd version in the kernel.
>> 
>> I've updated zstd to upstream with one big patch because every commit must 
>> build,
>> so that precludes partial updates. Since the commit is 100% generated, I 
>> hope the
>> review burden is lightened. I considered replaying upstream commits, but 
>> that is
>> not possible because there have been ~3500 upstream commits since the last 
>> zstd
>> import, and the commits don't all build individually. The bulk update 
>> preserves
>> bisectablity because bugs can be bisected to the zstd version update. At that
>> point the update can be reverted, and we can work with upstream to find and 
>> fix
>> the bug. After this big switch in how the kernel consumes zstd, future 
>> patches
>> will be smaller, because they will only have one upstream release worth of
>> changes each.
>> 
>> This patchset changes the zstd API from a custom kernel API to the upstream 
>> API.
>> I considered wrapping the upstream API with a wrapper that is closer to the
>> kernel style guide. Following advise from https://lkml.org/lkml/2020/9/17/814
>> I've chosen to use the upstream API directly, to minimize opportunities to
>> introduce bugs, and because using the upstream API directly makes debugging 
>> and
>> communication with upstream easier.
>> 
>> This patchset comes in 3 parts:
>> 1. The first 2 patches prepare for the zstd upgrade. The first patch adds a
>>   compatibility wrapper so zstd can be upgraded without modifying any 
>> callers.
>>   The second patch adds an indirection for the lib/decompress_unzstd.c 
>> including
>>   of all decompression source files.
>> 2. Import zstd-1.4.6. This patch is completely generated from upstream using
>>   automated tooling.
>> 3. Update all callers to the zstd-1.4.6 API then delete the compatibility
>>   wrapper.
>> 
>> I tested every caller of zstd on x86_64. I tested both after the 1.4.6 
>> upgrade
>> using the compatibility wrapper, and after the final patch in this series. 
>> 
>> I tested kernel and initramfs decompression in i386 and arm.
>> 
>> I ran benchmarks to compare the current zstd in the kernel with zstd-1.4.6.
>> I benchmarked on x86_64 using QEMU with KVM enabled on an Intel i9-9900k.
>> I found:
>> * BtrFS zstd compression at levels 1 and 3 is 5% faster
>> * BtrFS zstd decompression+read is 15% faster
>> * SquashFS zstd decompression+read is 15% faster
>> * F2FS zstd compression+write at level 3 is 8% faster
>> * F2FS zstd decompression+read is 20% faster
>> * ZRAM decompression+read is 30% faster
>> * Kernel zstd decompression is 35% faster
>> * Initramfs zstd decompression+build is 5% faster
>> 
>> The latest zstd also offers bug fixes and a 1 KB reduction in stack uage 
>> during
>> compression. For example the recent problem with large kernel decompression 
>> has
>> been fixed upstream for over 2 years https://lkml.org/lkml/2020/9/29/27.
>> 
>> Please let me know if there is anything that I can do to ease the way for 
>> these
>> patches. I think it is important because it gets large performance 
>> 

Re: [PATCH v4 0/9] Update to zstd-1.4.6

2020-09-30 Thread Christoph Hellwig
As you keep resend this I keep retelling you that should not do it.
Please provide a proper Linux API, and switch to that.  Versioned APIs
have absolutely no business in the Linux kernel.

On Tue, Sep 29, 2020 at 11:53:09PM -0700, Nick Terrell wrote:
> From: Nick Terrell 
> 
> This patchset upgrades the zstd library to the latest upstream release. The
> current zstd version in the kernel is a modified version of upstream 
> zstd-1.3.1.
> At the time it was integrated, zstd wasn't ready to be used in the kernel 
> as-is.
> But, it is now possible to use upstream zstd directly in the kernel.
> 
> I have not yet release zstd-1.4.6 upstream. I want the zstd version in the 
> kernel
> to match up with a known upstream release, so we know exactly what code is
> running. Whenever this patchset is ready for merge, I will cut a release at 
> the
> upstream commit that gets merged. This should not be necessary for future
> releases.
> 
> The kernel zstd library is automatically generated from upstream zstd. A 
> script
> makes the necessary changes and imports it into the kernel. The changes are:
> 
> 1. Replace all libc dependencies with kernel replacements and rewrite 
> includes.
> 2. Remove unncessary portability macros like: #if defined(_MSC_VER).
> 3. Use the kernel xxhash instead of bundling it.
> 
> This automation gets tested every commit by upstream's continuous integration.
> When we cut a new zstd release, we will submit a patch to the kernel to update
> the zstd version in the kernel.
> 
> I've updated zstd to upstream with one big patch because every commit must 
> build,
> so that precludes partial updates. Since the commit is 100% generated, I hope 
> the
> review burden is lightened. I considered replaying upstream commits, but that 
> is
> not possible because there have been ~3500 upstream commits since the last 
> zstd
> import, and the commits don't all build individually. The bulk update 
> preserves
> bisectablity because bugs can be bisected to the zstd version update. At that
> point the update can be reverted, and we can work with upstream to find and 
> fix
> the bug. After this big switch in how the kernel consumes zstd, future patches
> will be smaller, because they will only have one upstream release worth of
> changes each.
> 
> This patchset changes the zstd API from a custom kernel API to the upstream 
> API.
> I considered wrapping the upstream API with a wrapper that is closer to the
> kernel style guide. Following advise from https://lkml.org/lkml/2020/9/17/814
> I've chosen to use the upstream API directly, to minimize opportunities to
> introduce bugs, and because using the upstream API directly makes debugging 
> and
> communication with upstream easier.
> 
> This patchset comes in 3 parts:
> 1. The first 2 patches prepare for the zstd upgrade. The first patch adds a
>compatibility wrapper so zstd can be upgraded without modifying any 
> callers.
>The second patch adds an indirection for the lib/decompress_unzstd.c 
> including
>of all decompression source files.
> 2. Import zstd-1.4.6. This patch is completely generated from upstream using
>automated tooling.
> 3. Update all callers to the zstd-1.4.6 API then delete the compatibility
>wrapper.
> 
> I tested every caller of zstd on x86_64. I tested both after the 1.4.6 upgrade
> using the compatibility wrapper, and after the final patch in this series. 
> 
> I tested kernel and initramfs decompression in i386 and arm.
> 
> I ran benchmarks to compare the current zstd in the kernel with zstd-1.4.6.
> I benchmarked on x86_64 using QEMU with KVM enabled on an Intel i9-9900k.
> I found:
> * BtrFS zstd compression at levels 1 and 3 is 5% faster
> * BtrFS zstd decompression+read is 15% faster
> * SquashFS zstd decompression+read is 15% faster
> * F2FS zstd compression+write at level 3 is 8% faster
> * F2FS zstd decompression+read is 20% faster
> * ZRAM decompression+read is 30% faster
> * Kernel zstd decompression is 35% faster
> * Initramfs zstd decompression+build is 5% faster
> 
> The latest zstd also offers bug fixes and a 1 KB reduction in stack uage 
> during
> compression. For example the recent problem with large kernel decompression 
> has
> been fixed upstream for over 2 years https://lkml.org/lkml/2020/9/29/27.
> 
> Please let me know if there is anything that I can do to ease the way for 
> these
> patches. I think it is important because it gets large performance 
> improvements,
> contains bug fixes, and is switching to a more maintainable model of consuming
> upstream zstd directly, making it easy to keep up to date.
> 
> Best,
> Nick Terrell
> 
> v1 -> v2:
> * Successfully tested F2FS with help from Chao Yu to fix my test.
> * (1/9) Fix ZSTD_initCStream() wrapper to handle pledged_src_size=0 means 
> unknown.
>   This fixes F2FS with the zstd-1.4.6 compatibility wrapper, exposed by the 
> test.
> 
> v2 -> v3:
> * (3/9) Silence warnings by Kernel Test Robot:
>   

[PATCH v4 0/9] Update to zstd-1.4.6

2020-09-30 Thread Nick Terrell
From: Nick Terrell 

This patchset upgrades the zstd library to the latest upstream release. The
current zstd version in the kernel is a modified version of upstream zstd-1.3.1.
At the time it was integrated, zstd wasn't ready to be used in the kernel as-is.
But, it is now possible to use upstream zstd directly in the kernel.

I have not yet release zstd-1.4.6 upstream. I want the zstd version in the 
kernel
to match up with a known upstream release, so we know exactly what code is
running. Whenever this patchset is ready for merge, I will cut a release at the
upstream commit that gets merged. This should not be necessary for future
releases.

The kernel zstd library is automatically generated from upstream zstd. A script
makes the necessary changes and imports it into the kernel. The changes are:

1. Replace all libc dependencies with kernel replacements and rewrite includes.
2. Remove unncessary portability macros like: #if defined(_MSC_VER).
3. Use the kernel xxhash instead of bundling it.

This automation gets tested every commit by upstream's continuous integration.
When we cut a new zstd release, we will submit a patch to the kernel to update
the zstd version in the kernel.

I've updated zstd to upstream with one big patch because every commit must 
build,
so that precludes partial updates. Since the commit is 100% generated, I hope 
the
review burden is lightened. I considered replaying upstream commits, but that is
not possible because there have been ~3500 upstream commits since the last zstd
import, and the commits don't all build individually. The bulk update preserves
bisectablity because bugs can be bisected to the zstd version update. At that
point the update can be reverted, and we can work with upstream to find and fix
the bug. After this big switch in how the kernel consumes zstd, future patches
will be smaller, because they will only have one upstream release worth of
changes each.

This patchset changes the zstd API from a custom kernel API to the upstream API.
I considered wrapping the upstream API with a wrapper that is closer to the
kernel style guide. Following advise from https://lkml.org/lkml/2020/9/17/814
I've chosen to use the upstream API directly, to minimize opportunities to
introduce bugs, and because using the upstream API directly makes debugging and
communication with upstream easier.

This patchset comes in 3 parts:
1. The first 2 patches prepare for the zstd upgrade. The first patch adds a
   compatibility wrapper so zstd can be upgraded without modifying any callers.
   The second patch adds an indirection for the lib/decompress_unzstd.c 
including
   of all decompression source files.
2. Import zstd-1.4.6. This patch is completely generated from upstream using
   automated tooling.
3. Update all callers to the zstd-1.4.6 API then delete the compatibility
   wrapper.

I tested every caller of zstd on x86_64. I tested both after the 1.4.6 upgrade
using the compatibility wrapper, and after the final patch in this series. 

I tested kernel and initramfs decompression in i386 and arm.

I ran benchmarks to compare the current zstd in the kernel with zstd-1.4.6.
I benchmarked on x86_64 using QEMU with KVM enabled on an Intel i9-9900k.
I found:
* BtrFS zstd compression at levels 1 and 3 is 5% faster
* BtrFS zstd decompression+read is 15% faster
* SquashFS zstd decompression+read is 15% faster
* F2FS zstd compression+write at level 3 is 8% faster
* F2FS zstd decompression+read is 20% faster
* ZRAM decompression+read is 30% faster
* Kernel zstd decompression is 35% faster
* Initramfs zstd decompression+build is 5% faster

The latest zstd also offers bug fixes and a 1 KB reduction in stack uage during
compression. For example the recent problem with large kernel decompression has
been fixed upstream for over 2 years https://lkml.org/lkml/2020/9/29/27.

Please let me know if there is anything that I can do to ease the way for these
patches. I think it is important because it gets large performance improvements,
contains bug fixes, and is switching to a more maintainable model of consuming
upstream zstd directly, making it easy to keep up to date.

Best,
Nick Terrell

v1 -> v2:
* Successfully tested F2FS with help from Chao Yu to fix my test.
* (1/9) Fix ZSTD_initCStream() wrapper to handle pledged_src_size=0 means 
unknown.
  This fixes F2FS with the zstd-1.4.6 compatibility wrapper, exposed by the 
test.

v2 -> v3:
* (3/9) Silence warnings by Kernel Test Robot:
  https://github.com/facebook/zstd/pull/2324
  Stack size warnings remain, but these aren't new, and the functions it warns 
on
  are either unused or not in the maximum stack path. This patchset reduces zstd
  compression stack usage by 1 KB overall. I've gotten the low hanging fruit, 
and
  more stack reduction would require significant changes that have the potential
  to introduce new bugs. However, I do hope to continue to reduce zstd stack
  usage in future versions.

v3 -> v4:
* (3/9) Fix errors and warnings