From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 1/3] kvm: dont hold pagecount reference for mapped sptes pages. Date: Thu, 9 Apr 2009 06:54:08 -0300 Message-ID: <20090409095408.GA31724@amt.cnet> References: <1238457604-7637-1-git-send-email-ieidus@redhat.com> <1238457604-7637-2-git-send-email-ieidus@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, avi@redhat.com To: Izik Eidus Return-path: Received: from mx2.redhat.com ([66.187.237.31]:47206 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765027AbZDIJyR (ORCPT ); Thu, 9 Apr 2009 05:54:17 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n399sHMY031233 for ; Thu, 9 Apr 2009 05:54:17 -0400 Content-Disposition: inline In-Reply-To: <1238457604-7637-2-git-send-email-ieidus@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 31, 2009 at 03:00:02AM +0300, Izik Eidus wrote: > When using mmu notifiers, we are allowed to remove the page count > reference tooken by get_user_pages to a specific page that is mapped > inside the shadow page tables. > > This is needed so we can balance the pagecount against mapcount > checking. > > (Right now kvm increase the pagecount and does not increase the > mapcount when mapping page into shadow page table entry, > so when comparing pagecount against mapcount, you have no > reliable result.) IMO ifdef'ing CONFIG_MMU_NOTIFIERS here (and keeping the ref if unset) instead of in the backward compat code gives less room for headaches.