From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andres Lagar-Cavilla" Subject: Re: [PATCH 6 of 8] x86/mm: Properly account for paged out pages Date: Thu, 26 Jan 2012 02:47:20 -0800 Message-ID: References: <20120126095401.GC21629@aepfle.de> Reply-To: andres@lagarcavilla.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120126095401.GC21629@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering Cc: andres@gridcentric.ca, xen-devel@lists.xensource.com, tim@xen.org, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org > On Wed, Jan 25, Andres Lagar-Cavilla wrote: > >> xen/arch/x86/mm/p2m.c | 3 ++- >> 1 files changed, 2 insertions(+), 1 deletions(-) >> >> >> If we hit the page after nominate but before paging it out, don't >> decrement the >> domain count of paged out pages. > > The meaning of paged_pages is to track released pages. > In p2m_mem_paging_evict() it gets incremented once the page is removed > from the domain, and in p2m_mem_paging_prep() it should be decremented > right after the alloc_domheap_page() call. > So the patch should move the atomic_dec() call after successful page > allocation. > > Olaf Hi Olaf, there is a put_page in case things go wrong, after the alloc_domheap_page call. So doing the decrement at alloc is a bit too soon. Thanks Andres > >> diff -r c41436e555cd -r d4336e35f0bc xen/arch/x86/mm/p2m.c >> --- a/xen/arch/x86/mm/p2m.c >> +++ b/xen/arch/x86/mm/p2m.c >> @@ -1041,7 +1041,8 @@ int p2m_mem_paging_prep(struct domain *d >> p2m_ram_rw, a); >> set_gpfn_from_mfn(mfn_x(mfn), gfn); >> >> - atomic_dec(&d->paged_pages); >> + if ( !page_extant ) >> + atomic_dec(&d->paged_pages); >> >> ret = 0; >> >