+Cc DeepSeek and Muchun On Fri, Sep 25, 2026 at 09:04:41AM +0200, David Hildenbrand (Arm) wrote: >On 9/25/26 07:44, Lance Yang wrote: >> Hi all, >> >> I was reading DeepSeek's new DSec paper[1] and found a nice use of DAMON >> and virtio-balloon: >> >> With this kind of workload, an agent may read a file once and never touch >> it again, while those pages remain in the guest page cache. Without memory >> pressure in the guest, they can stay cached even though the host would >> like that memory back ... >> >> The trick is DAMON + virtio-balloon free-page reporting :) DAMON reclaims > >Heh, I read "virtio-balloon" and thought "balloon inflation/deflation, what >year >is it?!". Free-page reporting makes much more sense. > >> cold file pages from the guest page cache; buddy gets a chance to coalesce >> them into reportable blocks, and virtio-balloon passes those blocks to >> Firecracker. Firecracker can then drop the host backing with MADV_DONTNEED. > >When I was at RH we were looking at this issue as well. virtio-pmem was one way >of avoiding the page cache in VM entirely. But it has its own limitations.
YES, they enable virtio-pmem with DAX for the read-only EROFS base-image and toolkit layers, while using DAMON with balloon free-page reporting to reclaim cold file pages from the guest page cache on larger writable disks. They also point out that the guest must allocate struct page metadata for the entire pmem-backed address range. So virtio-pmem is not free either :) BTW, Muchun recently posted a pretty cool series for exactly that: https://lore.kernel.org/linux-mm/[email protected]/ (It shares vmemmap backing until a DAX fault needs private metadata, avoiding the full per-PFN cost up front.) I have a feeling the DeepSeek team will be watching this one closely :P >Thanks for sharing! Cheers!
