Re: [PATCH v7 0/3] Update to zstd-1.4.6

2021-02-27 Thread Oleksandr Natalenko
de 100644 lib/zstd/decompress/zstd_ddict.h
>  create mode 100644 lib/zstd/decompress/zstd_decompress.c
>  create mode 100644 lib/zstd/decompress/zstd_decompress_block.c
>  create mode 100644 lib/zstd/decompress/zstd_decompress_block.h
>  create mode 100644 lib/zstd/decompress/zstd_decompress_internal.h
>  create mode 100644 lib/zstd/decompress_sources.h
>  delete mode 100644 lib/zstd/entropy_common.c
>  delete mode 100644 lib/zstd/error_private.h
>  delete mode 100644 lib/zstd/fse.h
>  delete mode 100644 lib/zstd/fse_compress.c
>  delete mode 100644 lib/zstd/fse_decompress.c
>  delete mode 100644 lib/zstd/huf.h
>  delete mode 100644 lib/zstd/huf_compress.c
>  delete mode 100644 lib/zstd/huf_decompress.c
>  delete mode 100644 lib/zstd/mem.h
>  delete mode 100644 lib/zstd/zstd_common.c
>  create mode 100644 lib/zstd/zstd_compress_module.c
>  create mode 100644 lib/zstd/zstd_decompress_module.c
>  delete mode 100644 lib/zstd/zstd_internal.h
>  delete mode 100644 lib/zstd/zstd_opt.h
> 
> -- 
> 2.29.2
> 

So, what's the fate of this submission please?

Thanks.

-- 
  Oleksandr Natalenko (post-factum)


Re: [PATCH v8 1/3] lib: zstd: Add kernel-specific API

2021-03-27 Thread Oleksandr Natalenko
Hello.

On Sat, Mar 27, 2021 at 05:48:01PM +0800, kernel test robot wrote:
> >> ERROR: modpost: "ZSTD_maxCLevel" [fs/f2fs/f2fs.ko] undefined!

Since f2fs can be built as a module, the following correction seems to
be needed:

```
diff --git a/lib/zstd/compress/zstd_compress.c 
b/lib/zstd/compress/zstd_compress.c
index 9c998052a0e5..584c92c51169 100644
--- a/lib/zstd/compress/zstd_compress.c
+++ b/lib/zstd/compress/zstd_compress.c
@@ -4860,6 +4860,7 @@ size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* 
output)
 
 #define ZSTD_MAX_CLEVEL 22
 int ZSTD_maxCLevel(void) { return ZSTD_MAX_CLEVEL; }
+EXPORT_SYMBOL(ZSTD_maxCLevel);
 int ZSTD_minCLevel(void) { return (int)-ZSTD_TARGETLENGTH_MAX; }
 
 static const ZSTD_compressionParameters 
ZSTD_defaultCParameters[4][ZSTD_MAX_CLEVEL+1] = {
```

Not sure if the same should be done for `ZSTD_minCLevel()` since I don't
see it being used anywhere else.

-- 
  Oleksandr Natalenko (post-factum)


Re: [GIT PULL][PATCH v9 0/3] Update to zstd-1.4.10

2021-03-31 Thread Oleksandr Natalenko
he 
> 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 reported by Kernel Test Robot:
>   https://github.com/facebook/zstd/pull/2326
>   - Replace mem.h with a custom kernel implementation that matches the current
> lib/zstd/mem.h in the kernel. This avoids calls to __builtin_bswap*() 
> which
> don't work on certain architectures, as exposed by the Kernel Test Robot.
>   - Remove ASAN/MSAN (un)poisoning code which doesn't work in the kernel, as
> exposed by the Kernel Test Robot.
>   - I've fixed all of the valid cppcheck warnings reported, but there were 
> many
> false positives, where cppcheck was incorrectly analyzing the situation,
> which I did not fix. I don't believe it is reasonable to expect that 
> upstream
> zstd silences all the static analyzer false positives. Upstream zstd uses
> clang scan-build for its static analysis. We find that supporting multiple
> static analysis tools multiplies the burden of silencing false positives,
> without providing enough marginal value over running a single static 
> analysis
> tool.
> 
> v4 -> v5:
> * Rebase onto v5.10-rc2
> * (6/9) Merge with other F2FS changes (no functional change in patch).
> 
> v5 -> v6:
> * Rebase onto v5.10-rc6.
> * Switch to using a kernel style wrapper API as suggested by Cristoph.
> 
> v6 -> v7:
> * Expose the upstream library header as `include/linux/zstd_lib.h`.
>   Instead of creating new structs mirroring the upstream zstd structs
>   use upstream's structs directly with a typedef to get a kernel style name.
>   This removes the memcpy cruft.
> * (1/3) Undo ZSTD_WINDOWLOG_MAX and handle_zstd_error changes.
> * (3/3) Expose zstd_errors.h as `include/linux/zstd_errors.h` because it
>   is needed by the kernel wrapper API.
> 
> v7 -> v8:
> * (1/3) Fix typo in EXPORT_SYMBOL().
> * (1/3) Fix typo in zstd.h comments.
> * (3/3) Update to latest zstd release: 1.4.6 -> 1.4.10
> This includes ~1KB of stack space reductions.
> 
> v8 -> v9:
> * (1/3) Rebase onto v5.12-rc5
> * (1/3) Add zstd_min_clevel() & zstd_max_clevel() and use in f2fs.
> Thanks to Oleksandr Natalenko for spotting it!
> * (1/3) Move lib/decompress_unzstd.c usage of ZSTD_getErrorCode()
> to zstd_get_error_code().
> * (1/3) Update modified zstd headers to yearless copyright.
> * (2/3) Add copyright/license header to decompress_sources.h for consistency.
> * (3/3) Update to yearless copyright for all zstd files. Thanks to
> Mike Dolan for spotting it!
> 
> Nick Terrell (3):
>   lib: zstd: Add kernel-specific API
>   lib: zstd: Add decompress_sources.h for decompress_unzstd
>   lib: zstd: Upgrade to latest upstream zstd version 1.4.10
> 
>  crypto/zstd.c |   28 +-
>  fs/btrfs/zstd.c   |   68 +-
>  fs/f2fs/compress.c|   56 +-
>  fs/f2fs/super.c   |2 +-
>  fs/pstore/platform.c  |2 +-
>  fs/squashfs/zstd_wrapper.c|   16 +-
>  include/linux/zstd.h  | 1252 +---
>  include/linux/zstd_errors.h   |   77 +
>  include/linux/zstd_lib.h  | 2432 
>  lib/decompress_unzstd.c   |   48 +-
>  lib/zstd/Makefile |   44 +-
>  lib/zstd/bitstream.h  |  380 --
>  lib/zstd/common/bitstream.h   |  437 ++
>  lib/zstd/common/compiler.h|  151 +
>  lib/zstd/common/cpu.h |  194 +
>  lib/zstd/common/debug.c   |   24 +
>  lib/zstd/common/debug.h   |  101 +
>  lib/zstd/common/entropy_common.c  |  357 ++
>  lib/zstd/common/error_private.c   |   56 +
>  lib/zstd/common/error_private.h   |   66 +
>  lib/zstd/common/fse.h |  710 +++
>  lib/zstd/common/fse_decompress.c  |  390 ++
>  lib/zstd/common/huf.h |  356 ++
>  lib/zstd/common