From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: Re: [RFC][Patch v8 0/7] KVM: Guest Free Page Hinting Date: Thu, 14 Feb 2019 10:42:39 +0100 Message-ID: References: <20190204201854.2328-1-nitesh@redhat.com> <286AC319A985734F985F78AFA26841F73DF6B56A@shsmsx102.ccr.corp.intel.com> <286AC319A985734F985F78AFA26841F73DF6F0E3@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: "Wang, Wei W" , 'Nitesh Narayan Lal' , "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" , "mst@redhat.com" , "dodgen@google.com" , "konrad.wilk@oracle.com" , "dhildenb@redhat.com" , "aarcange@redhat.com" Return-path: In-Reply-To: <286AC319A985734F985F78AFA26841F73DF6F0E3@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 09:48, Wang, Wei W wrote: > On Wednesday, February 13, 2019 8:07 PM, Nitesh Narayan Lal wrote: >> Once the host free the pages. All the isolated pages are returned back >> to the buddy. (This is implemented in hyperlist_ready()) > > This actually has the same issue: the isolated pages have to wait to return to the buddy > after the host has done with madvise(DONTNEED). Otherwise, a page could be used by > a guest thread and the next moment the host takes it to other host threads. Yes indeed, that is the important bit. They must not be put pack to the buddy before they have been processed by the hypervisor. But as the pages are not in the buddy, no one allocating a page will stumble over such a page and try to allocate it. Threads trying to allocate memory will simply pick another buddy page instead of "busy waiting" for that page to be finished reporting. > > Best, > Wei > -- Thanks, David / dhildenb