From: David Hildenbrand Subject: Re: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting Date: Thu, 14 Feb 2019 10:34:28 +0100 Message-ID: <401883fd-bdad-6e34-cabe-c9b8fdadce92@redhat.com> References: <20190204201854.2328-1-nitesh@redhat.com> <286AC319A985734F985F78AFA26841F73DF68060@shsmsx102.ccr.corp.intel.com> <17adc05d-91f9-682b-d9a4-485e6a631422@redhat.com> <286AC319A985734F985F78AFA26841F73DF6B52A@shsmsx102.ccr.corp.intel.com> <62b43699-f548-e0da-c944-80702ceb7202@redhat.com> <6198f4b9-47ad-2647-73de-da057541c45f@redhat.com> <20190213120733-mutt-send-email-mst@kernel.org> <286AC319A985734F985F78AFA26841F73DF6F1C3@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "pbonzini@redhat.com" , "lcapitulino@redhat.com" , "pagupta@redhat.com" , "yang.zhang.wz@gmail.com" , "riel@surriel.com" , "dodgen@google.com" , "konrad.wilk@oracle.com" , "dhildenb@redhat.com" , "aarcange@redhat.com" To: "Wang, Wei W" , 'Nitesh Narayan Lal' , "Michael S. Tsirkin" Return-path: In-Reply-To: <286AC319A985734F985F78AFA26841F73DF6F1C3@shsmsx102.ccr.corp.intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 14.02.19 10:12, Wang, Wei W wrote: > On Thursday, February 14, 2019 1:22 AM, Nitesh Narayan Lal wrote: >> In normal condition yes we would not like to report any memory when the >> guest is already under memory pressure. >> >> I am not sure about the scenario where both guest and the host are under >> memory pressure, who will be given priority? Is it something per-decided or >> it depends on the use case? >> > > That's one of the reasons that I would vote for "host to ask for free pages". As I already said, there are scenarios where this does not work reliably. When we 1. Let the guest report free pages 2. Allow the hypervisor to enable/disable it We have a mechanism that is superior to what you describe. "host to ask for free pages" can be emulated using that. > > Host can have a global view of all the guest's memory states, so better to have the > memory overcommitment policy defined on the host. > > For example, the host can know guest1 is under memory pressure (thus not asking him) > and guest2 has a huge amount of free memory. When host lacks memory to run the 3rd > guest, it can asks guest2 to offer some free memory. > > Best, > Wei > -- Thanks, David / dhildenb