Amazon Working On New Proactive Memory Reclamation For The Linux Kernel
This week Amazon sent out their second "request for comments" patch series implementing DAMON-based proactive reclamation of memory pages. This kernel module would provide page reclamation with using DAMON to monitor data accesses in figuring out the cold pages. The patch series explains, "It finds memory regions that didn't accessed for specific time duration and page out. To avoid it consuming too much CPU for the paging out operations, the speed limit can be configured. Under the speed limit, it pages out memory regions that didn't accessed longer first. Also, to remove the monitoring overhead under peaceful situation, and to fall back to the LRU-list based page granularity reclamation when it doesn't make progress, the three watermarks based activation mechanism is used, with the free memory ratio as the watermark metric. For convenient configuration, it utilizes module parameters. Using these, sysadmins can enable/disable it and tune the coldness identification time threshold, the speed limit, and the three watermarks."
The performance of this DAMON-based page reclamation for Linux is sounding good, "DAMON_RECLAIM on v5.12 Linux kernel with ZRAM swap device and 10GB/s speed limit achieves 32% memory saving with only 1.91% runtime overhead. For this, DAMON_RECLAIM consumes only 5.72% of single CPU time. Among the CPU consumption, only about 1.448% of single CPU time is expected to be used for the access pattern monitoring."
Those wanting to find out more about this Amazon Linux kernel initiative can see this patch series and more information via this kernel mailing list thread.