ZRAM is the memory optimization module of the kernel. It first defines an area, and then puts the compressed hard disk data into this area to achieve high-speed reading. Currently Linux 6.2 has incorporated support for multiple compressed streams in ZRAM as part of memory management related patches.
Google engineers have been working on implementing multi-compression stream support in ZRAM, and it appears to be ready to use it on Chrome OS. Multi-compressed streams in ZRAM supports processing multiple compressed streams on a per-CPU basis. The main idea is that different compression algorithms have different characteristics, and ZRAM may benefit from using a combination of algorithms, such as some are fast but A compression algorithm with a lower compression ratio can be decompressed with an auxiliary algorithm that is slower but has a higher compression ratio.
According to ZRAM’s documentation, there are several use cases for this feature:
Huge page recompression: zstd or defalte can successfully compress huge pages (about 50% of huge pages in synthetic ChromeOS tests), IOW pages that lzo can’t compress.
Free page recompression: Free/cold pages are located in memory, if we recompress these free pages, we may reduce zsmalloc memory usage.
Userspace has many ways to control the behavior and impact of zram recompression: what type of pages should be recompressed, size watermarks, etc. This makes ZRAM’s compression more flexible.
After merging the latest patch, two new sysfs attributes “recomp_algorithm” and “recompress” have been added to the ZRAM device, which can be used to complete the management of the secondary compression algorithm. A ZRAM device with the ZRAM_MULTI_COMP option enabled supports up to four different compression algorithms.
Learn more details about ZRAM multi-compression stream support through the documentation, or check out the ZRAM multi-compression stream patch mail.
#Linux #supports #multiple #compressed #streams #ZRAM #News Fast Delivery