From: David Hildenbrand Subject: Re: On guest free page hinting and OOM Date: Tue, 2 Apr 2019 22:32:58 +0200 Message-ID: References: <20190401104608-mutt-send-email-mst@kernel.org> <6a612adf-e9c3-6aff-3285-2e2d02c8b80d@redhat.com> <20190402112115-mutt-send-email-mst@kernel.org> <3dd76ce6-c138-b019-3a43-0bb0b793690a@redhat.com> <6b0a3610-0e7b-08dc-8b5f-707062f87bea@redhat.com> <20190402154732-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Alexander Duyck , Nitesh Narayan Lal , kvm list , LKML , linux-mm , Paolo Bonzini , lcapitulino@redhat.com, pagupta@redhat.com, Yang Zhang , Rik van Riel , dodgen@google.com, Konrad Rzeszutek Wilk , dhildenb@redhat.com, Andrea Arcangeli , Dave Hansen To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20190402154732-mutt-send-email-mst@kernel.org> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 02.04.19 21:49, Michael S. Tsirkin wrote: > On Tue, Apr 02, 2019 at 08:21:30PM +0200, David Hildenbrand wrote: >> The other extreme is a system that barely frees (MAX_ORDER - X) pages, >> however your thread will waste cycles scanning for such. > > I don't think we need to scan as such. An arch hook > that queues a job to a wq only when there's work to > do will fix the issue, right? > Well, even a system that is basically idle can theoretically free a handful of pages every now and then you would like to report. There would have to be a mechanism to detect if pages worth hinting have been freed and need processing, IOW something like a callback after buddy merging we are already dealing with. That can then be a simple flag which the hinting thread considers (e.g. wake up every X seconds to check if there is work) or kicking the hinting thread like you suggest. -- Thanks, David / dhildenb