RFC vmrd: dynamic guest VM memory resizing daemon
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | vmrd: dynamic guest VM memory resizing daemonMakefile.am vmrd.cpp | +1168 | 0 replies | |
| 2/2 | vmrd: add implementation of memory plugin interfacesvmrd.cpp | +117 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/2] vmrd: dynamic guest VM memory resizing daemon
VM Memory Resizing Daemon (vmrd)
Initial idea of dynamic memory resizing for guest VMs was discussed here in this thread below as a RFC.
https://lore.kernel.org/linux-arm-kernel/[email protected]/T/
Posting the source-code for this userspace daemon written in native C++ as RFC on such an approach for resizing the VM. We will be merging this into Github or CodeLinaro after gathering all the review comments. The userspace daemon registers to Linux kernel's PSI mechanism and it should work on any systems running Linux with CONFIG_PSI enabled.
This daemon adds memory to guest VM when demand for memory increases, and tracks for memory pressure going down as the usecase ends and frees memory to release memory back to host proactively. virtio-mem is used as interface for adding/removing memory in the guest VM. More details on the detail and implementation in patch commit text and RFC discuss thread mentioned above.
PATCH 2 shows the vendor specific implementation by Qualcomm on the memory plugin interfaces for adding/removing memory to VM by using modified virtio-mem driver, which uses mem-buf driver for communication between the VMs. More details on PATCH 2.
This vendor specific implementation is shown just as a reference and different user/vendor can have their own implementation.
We also intend to make these memory plugin interfaces generic so that we have an upstream-friendly mechanism for lending memory from the host to guest VMs. This is still on the works and wanted to seek upstream community's inputs on how we can achieve this. This way, vmrd can run on any guest running Linux with CONFIG_PSI and virtio-mem enabled which will be agnostic to the underlying Hypervisor.
Qualcomm has been using this daemon into its guest VMs for memory resizing. This has been currently tested with Gunyah Hypervisor and not on any other Hypervisor. Currently, the guest VM memory is resized by expanding Movable zone only, since virtio-mem uses memory hotplug and Movable zone guarantees memory blocks to be isolated and offlined. Next incremental patches of this feature will be shared soon where both Normal and Movable zone can be resized, thereby increasing headroom for both DMA (unmovable) and userspace (movable) memory.
Sudarshan Rajagopalan (2):
vmrd: dynamic guest VM memory resizing daemon
vmrd: add implementation of memory plugin interfaces
Makefile.am | 14 + vmrd.cpp | 1259 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1273 insertions(+) create mode 100644 Makefile.am create mode 100644 vmrd.cpp
Signature · 1 line
2.7.4