Ahead of the Linux 6.16 merge window opening up in just one month, the new Zblock allocator was queued up into Andrew Morton’s “MM” tree of memory management material likely destined for the next kernel merge window. Zblock is showing much potential as a compressed slab memory allocator.
Vitaly Wool of Konsulko AB has been working on this special-purpose allocator for storing compressed pages. Zblock aims to allow densely arranging objects of various sizes while enjoying low internal fragmentation. Zblock has been shown capable of delivering compression ratios “substantially higher” than the likes of Z3fold and Zbud. Zblock is also better than Zsmalloc for average performance and worst execution times. The documentation notes testing of Zblock on a Raspberry Pi 5 yields around 5~10% higher bogo ops/s over Zsmalloc.
Z3fold and Zbud were dropped from the mainline kernel as they were already deprecated. Zblock is now looking to join the party for competing with Zsmalloc.
Vitaly Wool commented on the Zblock allocator patch in mm.git:
“zblock is a special purpose allocator for storing compressed pages. It stores integer number of same size objects per its block. These blocks consist of several physical pages (2**n, i. e. 1/2/4/8).
With zblock, it is possible to densely arrange objects of various sizes resulting in low internal fragmentation. Also this allocator tries to fill incomplete blocks instead of adding new ones, in many cases providing a compression ratio comparable to zmalloc’s.
zblock is also in most cases superior to zsmalloc with regard to average performance and worst execution times, thus allowing for better response time and real-time characteristics of the whole system.
High memory and page migration are currently not supported by zblock.
Test results (zstd compressor, 8 core Ryzen 9 VM, make bzImage):
– zblock:
real 6m52.621s
user 33m41.771s
sys 6m28.825s
Zswap: 162328 kB
Zswapped: 754468 kB
zswpin 93851
zswpout 542481
zswpwb 935
– zsmalloc:
real 7m4.355s
user 34m37.538s
sys 6m22.086s
zswpin 101243
zswpout 448217
zswpwb 640
Zswap: 175704 kB
Zswapped: 778692 kB”
So if all goes well, Zblock could be submitted as part of the new MM material for the upcoming Linux 6.16 cycle.