Re: [RFC PATCH 00/16] mm: add in-memory compression of reclaimed pages
From: Nhat Pham
Date: Mon Nov 16 2026 - 09:14:03 EST
On Mon, Nov 16, 2026 at 3:03 AM nakixii <nakixii@xxxxxxxxx> wrote:
>
> This is a proof of concept, posted to ask whether the approach is worth
> pursuing. It is not meant for merging. The series is based on Linux
> 6.12.23, not on mm-unstable, and has not been ported to the swap-table
> and zpool changes that have landed since. If there is interest, the
> next version will be rebased onto mm-unstable.
>
> memcomp stores reclaimed anonymous and shmem pages in compressed form
> in memory, using the kernel's compressors and zsmalloc unchanged.
> Reclaim replaces the PTE, or the shmem page-cache entry, with a
> swap-like token that names a 16-byte slot. A fault on the token
> decompresses the page and maps it again. No block device is needed. If
> swap is configured, cold entries can be written back to it. The sysfs
> interface is under /sys/kernel/mm/memcomp.
>
> The implementation uses 16-byte slots, a separate owner domain for zero
> pages, per-key storage and bounded metadata aging. Memory-cgroup
> accounting, cold-page writeback, asynchronous compression, precise
> residency reporting and mincore support are separate patches.
>
> Refaults follow stock workingset accounting. The first reader claims
> and clears the shadow under the slot lock. Feedback runs after
> charging, outside the PTL and slot locks, before the page is read and
> installed. Consumed feedback is not restored if the read or the
> installation fails. An mTHP uses the shadow of its first base page and
> clears the shadows of all its pages. Swapoff returns payloads to the
> pool without building user pages.
>
What's the motivation of this line of work?