Re: [RFC][Patch v9 0/6] KVM: Guest Free Page Hinting

From: David Hildenbrand
Date: Tue Mar 12 2019 - 15:58:48 EST


On 07.03.19 19:46, Michael S. Tsirkin wrote:
> On Wed, Mar 06, 2019 at 10:00:05AM -0800, Alexander Duyck wrote:
>> I have been thinking about this. Instead of stealing the page couldn't
>> you simply flag it that there is a hint in progress and simply wait in
>> arch_alloc_page until the hint has been processed? The problem is in
>> stealing pages you are going to introduce false OOM issues when the
>> memory isn't available because it is being hinted on.
>
> Can we not give them back in an OOM notifier?
>

In the OOM notifier we might simply return "pages made available" as
long as some pages are currently being hinted. We can use an atomic_t to
track the number of requests that are sill being processed by the
hypervisor.

The larger the page granularity we have, the less likely the issue in
running into this. But yes, it might happen if the starts align.

--

Thanks,

David / dhildenb