Re:Do not buy RAM, compress
by acchow on Thursday November 19, 2026 @06:04PM
(#50567817)
I'm learning about this now. Apparently it's not as simple as comparing decompression speeds vs memory bandwidth.
Compression happens in 16KB pages. But memory reads can be 64-byte or 128-byte lines. So from a compressed page, the CPU cannot directly read a line from memory.
So to read even a single 8-byte line, the kernel will page fault, allocate a fresh 16KB page, decompress the entire 16KB page into it, update the page tables, flush the TLB, then resume execution.
Compression happens in 16KB pages. But memory reads can be 64-byte or 128-byte lines. So from a compressed page, the CPU cannot directly read a line from memory.
So to read even a single 8-byte line, the kernel will page fault, allocate a fresh 16KB page, decompress the entire 16KB page into it, update the page tables, flush the TLB, then resume execution.