From: Takuya Yoshikawa Subject: Re: [PATCH unit-tests] Add async page fault test Date: Wed, 9 May 2012 22:18:07 +0900 Message-ID: <20120509221807.8d04edc62ad1986785109cf1@gmail.com> References: <20120508112446.GB8988@redhat.com> <4FAA2AD7.7050109@redhat.com> <20120509084119.GP15960@redhat.com> <4FAA3059.2040105@redhat.com> <20120509085917.GR15960@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, mtosatti@redhat.com To: Gleb Natapov Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:38022 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757984Ab2EINSN (ORCPT ); Wed, 9 May 2012 09:18:13 -0400 Received: by pbbrp8 with SMTP id rp8so494007pbb.19 for ; Wed, 09 May 2012 06:18:13 -0700 (PDT) In-Reply-To: <20120509085917.GR15960@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 9 May 2012 11:59:17 +0300 Gleb Natapov wrote: > Hmm, yes if it is file backed it may work. Setting up qemu to use file > backed memory is one more complication while running the test though. > I haven't checked by I am not sure that MADV_DONTNEED will drop page > immediately though. It probably puts it on some list to be freed later. > Hmm actually looking at the comments it seems like this is what happens: > > /* > * Application no longer needs these pages. If the pages are dirty, > * it's OK to just throw them away. The app will be more careful about > * data it wants to keep. Be sure to free swap resources too. The > * zap_page_range call sets things up for shrink_active_list to actually > * free > * these pages later if no one else has touched them in the meantime, > * although we could add these pages to a global reuse list for > * shrink_active_list to pick up before reclaiming other pages. > */ zap_page_range() actually frees these pages, no? Virtio balloon seems to rely on this. Thanks, Takuya