On Tue, Feb 28, 2023 at 2:21 AM David Hildenbrand <david@xxxxxxxxxx> wrote: > > What we actually might want is a way to tell the OS ruining inside the > VM to "please try not using more than XXX MiB of physical memory" but > treat it as a soft limit. So in case we mess up, or there is a sudden > peak in memory consumption due to a workload, we won't harm the guest > OS/workload, and don't have to act immediately to avoid trouble. One can > think of it like an evolution of memory ballooning: instead of creating > artificial memory pressure by inflating the balloon that is fairly event > driven and requires explicit memory deflation, we teach the OS to do it > natively and pair it with free page reporting. That's interesting. In our forthcoming balloon spec for this feature, we provide a way to send such data from the host to the guest. We call the general mechanism "notifications" right now, but we did not think of that use case so far. > > All free physical memory inside the VM can be reported using free page > reporting to the hypervisor, and the OS will try sticking to the > requested "logical" VM size, unless there is real demand for more memory. > Yes, the two mechanisms can definitely work in tandem for such a use case, although we have not tried that yet. Thanks for these ideas. -T.J.