Linaro Connect 24

Cover image

Join us at Linaro Connect, where innovation meets collaboration!

Discover the future of ARM open-source software, network with industry leaders, engineers, and ARM software experts, and don’t forget the Linaro Connect hacking sessions.

Let’s connect, learn, and innovate together.

May 14, 2024

1 week ago

May 17, 2024

4 days ago

Madrid, Spain

MAD24-406 Dynamic VM memory resizing daemon (vmrd)

Session

Virtualization

VM Memory Resizing Daemon (vmrd). We describe about a userspace daemon that registers to the Linux kernel's PSI mechanism for monitoring and detecting memory pressure events in the system, and requests for adding/removing memory blocks from the host based on real-time memory demands in the system. This dynamic approach makes it guest driven without need for intervention of an admin/host. The virtio-mem interface is used for communicating with the host for adding/removing memory blocks. Detecting increase in memory demand – the daemon registers to certain PSI events and monitors pressure building up when memory allocations occurs. With set thresholds, even the slightest memory pressure triggers the daemon to make an educated guess that a memory requiring use case is active and requests additional memory from the host. Detecting decrease in memory pressure – the daemon monitors pressure decay and psi averages (avg10, avg60, avg300) and along with other memory stats. Based on these metrics, it makes an educated guess that the usecase has ended and frees up memory by releasing it back to host. The process of tracking memory pressure going down and releasing memory back to host is done in a separate thread. This gives a fully dynamic and on-demand approach of resizing the VM system memory by way of detecting memory pressures using the kernel PSI mechanism. The native userspace daemon is also CPU architecture and Hypervisor agnostic. More details on design and logic will be explained in the presentation session.

Presented by

Profile Picture
Sudarshan Rajagopalan
Staff Engineer, Linux Kernel Developer at Qualcomm
Working as Linux Kernel Developer in Qualcomm in the core kernel team. Interests are in Embedded Systems and Firmware, System designs and Computer Architecture. View more