Linux Patches Improve VM Guest Performance When The Host Encounters Memory Pressure

Written by Michael Larabel in Virtualization on 27 May 2023 at 08:22 AM EDT. 2 Comments
An updated set of patches were posted on Friday that seem to improve the Linux guest VM performance when the host is under heavy memory pressure.

Since mid-2021 Google's ChromeOS has been using similar code on "tens of millions devices" and recently Google engineer Yu Zhao -- known for his work on MGLRU -- has been working to upstream this improvement.

The intent of the patches is to provide a fast path for clearing the accessed bit without taking the KVM MMU lock. Yu Zhao previously posted these patches in February while Friday's v2 patches refactor the code and incorporate feedback from earlier review.

The patch series explains:
"The goal of this patchset is to optimize the performance of guests when the host memory is overcommitted. It focuses on a simple yet common case where hardware sets the accessed bit in KVM PTEs and VMs are not nested. Complex cases fall back to the existing slow path where kvm->mmu_lock is then taken.

The fast path relies on two techniques to safely clear the accessed bit: RCU and CAS. The former protects KVM page tables from being freed while the latter clears the accessed bit atomically against both the hardware and other software page table walkers."

Benchmarks are said to be coming soon for quantifying the VM guest performance improvement while the host is challenged by memory pressure.

Broken RAM

Google engineers are also working on Working Set Reporting for better dealing with over-committed VMs as another improvement for the kernel.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week