[GSoC 2026] [RFC] mm: Add memory compression support using Decorator pattern (PoC)#2894
[GSoC 2026] [RFC] mm: Add memory compression support using Decorator pattern (PoC)#2894DongSunchao wants to merge 1 commit into
Conversation
…pattern (PoC) Signed-off-by: dong sunchao <dongsunchao@gmail.com>
@DongSunchao We use a slightly different approach to implement compression support in CRIU. The following presentation provides more information: https://lpc.events/event/19/contributions/2236/ |
|
@rst0git I‘ve been analyzing the CRaC fork deeply. I'm really glad we choose the same algorithm(LZ4). While the CRaC implementation is a great reference(especially using the stardand LZ4 function to replace My plan is to implement a streaming approach with an Index Table. This should allow criu to process the large images (16G+) rather than failing with out-of-memory. |
|
@DongSunchao I think there may have been a misunderstanding about the presentation - CRaC's compression mechanism is not intended as a reference; it is used only as a baseline for our evaluation. The following pull request implements the functionality shown in the presentation: #2895 |
|
@rst0git Thank you for the clarification. I've carefully reviewed #2895 . I now basically understand how it implements the compression and uncompression by However, I believe we can improve the implementation by using the Decorator pattern instead of adding more logic into |
|
Hi @rst0git, @avagin , @Snorch , I noticed that the 'Add support for memory compression' idea was recently removed from the GSoC 2026 ideas list. Since I have been actively working on this PoC and am highly passionate about implementing this feature for GSoC, I wanted to quickly check the status of this idea. If it was removed because the technical scope or priority of CRIU has changed, could you let me know? I would be very happy to pivot to another high-priority issue or adjust my current proposal to better align with your needs. If it is still a valid project but just hidden from the main list, I will continue refining this PoC and my proposal based on any feedback you might have. Thank you for your time and guidance! |
|
@DongSunchao Thank you for working on this and you are more than welcome to contribute! We added this project idea for last year's GSoC, and since then I have been working on this as part of my PhD research. It is of relatively high priority for us, as we plan to integrate this functionality also with support for encryption. Both features are relatively complex and require extensive testing before we can merge them upstream. For now we decided to remove the project idea from the list to avoid duplicating efforts. I would be happy to help with the application process for GSoC, please reach out if you have any questions! |
|
@rst0git Thank you so much for the clarification! It makes sense to remove the idea to avoid duplicating the core work of your PhD research. I really appreciate the detailed discussions and the materials you offered. Analyzing PR #2895 and discussing the IO pipeline/daemon architecture has been a fantastic learning experience and helped me understand CRIU's internals much better. As you kindly suggested, I will trun to another active idea on the list. I will follow up with you via email regarding my application and the new direction. Thanks again for your time and guidance! |
Summary
This is a Proof-of-Concept (PoC) implementation for the GSoC 2026 project: "Add support for memory compression".
This PR introduces a Decorator Pattern to hook into the
page-xferlayer. It allows transparent compression of memory pages during checkpointing without modifying the coremem.clogic or function signatures.Key Implementation Details
Decorator Pattern:
open_page_xferto inject a compression layer (criu/page-xfer-compress.c).Buffering Strategy:
Data Flow:
mem.c(write_pages) -> Compress Buffer ->LZ4->orig_xfer->write_pages(Compressed Blob with Header)Verification (PoC Status)
I have verified the implementation with a live dump process. The logs confirm that the decorator successfully intercepts the memory stream and compresses data.
Results observed:
--compress-lz4.Pending / GSoC Roadmap
This PoC focuses on the Dump path. The planned work for the GSoC period includes:
pagemapoffset corrections (currently pass-through).Feedback Needed
I would appreciate feedback on the architectural approach (Decorator + Buffer). Is this the direction the team prefers for isolating compression logic?
Signed-off-by: dong sunchao [dongsunchao@gmail.com]