Bug 2034834
| Summary: | Backport zstd from Linux 5.16 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Neal Gompa <ngompa13> |
| Component: | kernel | Assignee: | Vladislav Dronov <vdronov> |
| kernel sub component: | Block Layer | QA Contact: | ChanghuiZhong <czhong> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | unspecified | CC: | bstinson, carl, davide, guazhang, jmoyer, jwboyer, michel, terrelln, vdronov |
| Version: | CentOS Stream | Keywords: | FutureFeature, Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | kernel-5.14.0-45.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-05-17 15:43:49 UTC | Type: | Feature Request |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 2032758 | ||
| Bug Blocks: | |||
|
Description
Neal Gompa
2021-12-22 10:00:49 UTC
MR proposed: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/292 a suggested action plan for testing: use zram disk with zstd compression docs: https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html ### create one zram device # modprobe zram num_devices=1 ### check and set zstd compression # cat /sys/block/zram0/comp_algorithm lzo [lzo-rle] lz4 lz4hc 842 zstd # echo zstd > /sys/block/zram0/comp_algorithm # cat /sys/block/zram0/comp_algorithm lzo lzo-rle lz4 lz4hc 842 [zstd] ### set max ram usage = 256 Mbytes # echo 256M > /sys/block/zram0/disksize ### write, read and test some data (/boot, for example) # mke2fs -m 0 -b 4096 -O sparse_super -L zram /dev/zram0 # mount -o relatime,noexec,nosuid /dev/zram0 /mnt/zram # cp -rp /boot /mnt/zram # diff -rp /boot /mnt/zram/boot < *** must be no output here *** > ### get funny stats # awk '{ print "uncompressed size of data",$1,"\ncompressed size of data", $2, "\nmemory allocated for this disk", $3, "\nnumber of incompressible pages", $8 }' /sys/block/zram0/mm_stat uncompressed size of data 185937920 compressed size of data 163488509 memory allocated for this disk 164663296 number of incompressible pages 36615 ### uncreate # umount /mnt/zram # rmmod zram Note that to test this, you'll need the MR for bug 2032758 to go with this. thanks Neal for the note, hi Vladis,can you help to build a test kernel, including this two MR ? https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/292 https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/262 Thanks thanks, Changhui, and i'm sorry for the mess, MRs 262 and 292 have to come together indeed. i've build a kernel with MR 292 right on top of MR 262: this is a kernel from bz2032758#c11 (see [1]): kernel-5.14.0-39.mrs_262_292.el9: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=42397520 initial test on my VM looks good: # modprobe zram num_devices=1 # cat /sys/block/zram0/comp_algorithm lzo [lzo-rle] zstd could you please use this kernel for testing? [1] $ git log 0f0dd1c8420c (HEAD -> zstd) lib: zstd: Don't add -O3 to cflags 62852e7bc46a lib: zstd: Don't inline functions in zstd_opt.c 4869198baf47 lib: zstd: Fix unused variable warning 87fe696e5bb5 lib: zstd: Add cast to silence clang's -Wbitwise-instead-of-logical c4025efb937f MAINTAINERS: Add maintainer entry for zstd 9f7ae1f3c31b lib: zstd: Upgrade to latest upstream zstd version 1.4.10 45795b46b636 lib: zstd: Add decompress_sources.h for decompress_unzstd 9223f0a77d04 lib: zstd: Add kernel-specific API 7c1cfa2db9d0 redhat/configs: Add explicit values for ZRAM_DEF_COMP_LZ4* configs d5b6434d7fc0 redhat/configs: Enable CONFIG_CRYPTO_ZSTD ce680337a17f redhat/configs: Migrate defaults for ZRAM from pending-common to common d27f92307dbf (tag: kernel-5.14.0-39.el9) [redhat] kernel-5.14.0-39.el9 (In reply to Vladis Dronov from comment #3) > a suggested action plan for testing: use zram disk with zstd compression i need to make a change to the suggested testing plan in c#3. in the current version we will be reading data from a page cache, not from zram disk, so compare operation will always succeed. can you please consider the following change in testing script: ... ### write some data (/boot, for example), un-mount and drop caches # mkdir -p /mnt/zram # mke2fs -m 0 -b 4096 -O sparse_super -L zram /dev/zram0 # mount -o relatime,noexec,nosuid /dev/zram0 /mnt/zram # cp -rp /boot /mnt/zram # umount /mnt/zram # echo 3 > /proc/sys/vm/drop_caches ### test the data # mount -o relatime,noexec,nosuid /dev/zram0 /mnt/zram # diff -rp /boot /mnt/zram/boot < *** must be no output here *** > ### clean up # umount /mnt/zram # rmdir /mnt/zram/ # rmmod zram Thanks to Vladis for rebuilding the new test kernel and modifying the test script. Tested on 5.14.0-39.mrs_262_292.el9 with good results, zstd compression functionality has enabled, zstd smoke and zstd compression test passed. # grep CONFIG_CRYPTO_ZSTD /boot/config-5.14.0-39.mrs_262_292.el9.x86_64 CONFIG_CRYPTO_ZSTD=m # grep CONFIG_ZSTD_COMPRESS /boot/config-5.14.0-39.mrs_262_292.el9.x86_64 CONFIG_ZSTD_COMPRESS=m :: [ 04:27:09 ] :: [ BEGIN ] :: Running 'uname -a' Linux storageqe-70.rhts.eng.pek2.redhat.com 5.14.0-39.mrs_262_292.el9.x86_64 #1 SMP PREEMPT Fri Jan 14 07:51:34 EST 2022 x86_64 x86_64 x86_64 GNU/Linux ::[04:27:09]::[BEGIN]:: Running 'cat /sys/block/zram0/comp_algorithm' lzo lzo-rle [zstd] ::[04:27:11]::[BEGIN]:: Running 'diff -rp /boot /mnt/zram/boot' :: [ 04:27:12 ] :: [ PASS ] :: Command 'diff -rp /boot /mnt/zram/boot' (Expected 0, got 0) uncompressed size of data 261521408 compressed size of data 233442811 memory allocated for this disk 234971136 number of incompressible pages 52081 Tested on kernel-5.14.0-47.el9, zstd compression functionality has enabled, zstd smoke and zstd compression test passed https://beaker.engineering.redhat.com/jobs/6216984 # grep CONFIG_CRYPTO_ZSTD /boot/config-5.14.0-47.el9.x86_64 CONFIG_CRYPTO_ZSTD=m # grep CONFIG_ZSTD_COMPRESS /boot/config-5.14.0-47.el9.x86_64 CONFIG_ZSTD_COMPRESS=m move to verified Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (new packages: kernel), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:3907 |