From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH unit-tests] Add async page fault test Date: Wed, 09 May 2012 16:20:23 +0300 Message-ID: <4FAA6F17.1070308@redhat.com> References: <20120508112446.GB8988@redhat.com> <4FAA2AD7.7050109@redhat.com> <20120509084119.GP15960@redhat.com> <4FAA3059.2040105@redhat.com> <20120509085917.GR15960@redhat.com> <20120509221807.8d04edc62ad1986785109cf1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm@vger.kernel.org, mtosatti@redhat.com To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:2073 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759005Ab2EINUc (ORCPT ); Wed, 9 May 2012 09:20:32 -0400 In-Reply-To: <20120509221807.8d04edc62ad1986785109cf1@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/09/2012 04:18 PM, Takuya Yoshikawa wrote: > 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. > The pages are removed from the user address space. But if they're not anonymous, the pages still live in the page cache. -- error compiling committee.c: too many arguments to function