commit deb2010011ed380615484f8dc568c8bea80c64c9 Author: Alexandre Frade Date: Mon Mar 22 06:09:06 2021 +0000 Linux 5.11.8-xanmod2 Signed-off-by: Alexandre Frade commit d91d3f6bd9947622d73a3c7d7112418ce10d8d60 Author: Nick Terrell Date: Fri Sep 11 16:37:08 2020 -0700 lib: zstd: Upgrade to latest upstream zstd version 1.4.6 Upgrade to the latest upstream zstd version 1.4.6. This patch is 100% generated from upstream zstd commit f45fa724fef1 [0]. This patch is very large because it is transitioning from the custom kernel zstd to using upstream directly. The new zstd follows upstreams file structure which is different. Future update patches will be much smaller because they will only contain the changes from one upstream zstd release. As an aid for review I've created a commit [1] that shows the diff between upstream zstd as-is (which doesn't compile), and the zstd code imported in this patch. The verion of zstd in this patch is generated from upstream with changes applied by automation to replace upstreams libc dependencies, remove unnecessary portability macros, and use the kernel's xxhash instead of bundling it. The benefits of this patch are as follows: 1. Using upstream directly with automated script to generate kernel code. This allows us to update the kernel every upstream release, so the kernel gets the latest bug fixes and performance improvements, and doesn't get 3 years out of date again. The automation and the translated code are tested every upstream commit to ensure it continues to work. 2. Upgrades from a custom zstd based on 1.3.1 to 1.4.6, getting 3 years of performance improvements and bug fixes. On x86_64 I've measured 15% faster BtrFS and SquashFS decompression+read speeds, 35% faster kernel decompression, and 30% faster ZRAM decompression+read speeds. Additionally, the latest zstd uses ~1 KB less stack space for compression. 3. Zstd-1.4.6 supports negative compression levels, which allow zstd to match or subsume lzo's performance. 4. Maintains the same kernel-specific wrapper API, so no callers have to be modified with zstd version updates. I chose the bulk update instead of replaying upstream commits because there have been ~3500 upstream commits since the 1.3.1 release, zstd wasn't ready to be used in the kernel as-is before a month ago, and not all upstream zstd commits build. 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. Note that upstream zstd release 1.4.6 doesn't exist yet. I have cut a staging branch at f45fa724fef1 [0] and will apply any changes requested to the staging branch. Once we're ready to merge this update I will cut a zstd release at the commit we merge, so we have a known zstd release in the kernel. The implementation of the kernel API is contained in zstd_compress_module.c and zstd_decompress_module.c. [0] https://github.com/facebook/zstd/commit/f45fa724fef1e70449fa3806dc2360dda467561b [1] https://github.com/terrelln/linux/commit/ac2ee65dcb7318afe426ad08f6a844faf3aebb41 Signed-off-by: Nick Terrell commit 026d9dc988057970c3d14bc661ec676f4e64f4dd Author: Nick Terrell Date: Mon Sep 14 12:54:12 2020 -0700 lib: zstd: Add decompress_sources.h for decompress_unzstd Adds decompress_sources.h which includes every .c file necessary for zstd decompression. This is used in decompress_unzstd.c so the internal structure of the library isn't exposed. This allows us to upgrade the zstd library version without modifying any callers. Instead we just need to update decompress_sources.h. Signed-off-by: Nick Terrell commit 510bfd2ecb1a8a825a6731be9bfcd2dc2e5a6bc3 Author: Nick Terrell Date: Fri Sep 11 16:49:00 2020 -0700 lib: zstd: Add kernel-specific API This patch: - Moves `include/linux/zstd.h` -> `include/linux/zstd_lib.h` - Adds a new API in `include/linux/zstd.h` that is functionally equivalent to the in-use subset of the current API. Functions are renamed to avoid symbol collisions with zstd, to make it clear it is not the upstream zstd API, and to follow the kernel style guide. - Updates all callers to use the new API. There are no functional changes in this patch. Since there are no functional change, I felt it was okay to update all the callers in a single patch, since once the API is approved, the callers are mechanically changed. This patch is preparing the next patch in the series, which updates zstd to version 1.4.6. Since the upstream zstd API is no longer exposed to callers, the update can happen transparently. Signed-off-by: Nick Terrell