From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 3/5] KVM: add kvm_follow_page() Date: Sun, 23 Dec 2007 13:01:25 +0200 Message-ID: <476E4005.90003@qumranet.com> References: <20071221001821.029994250@redhat.com> <20071221002024.345682789@redhat.com> <476D68A3.3000200@qumranet.com> <20071223052513.GA19072@dmt> <476E083B.5040600@qumranet.com> <476E1F23.3020609@qumranet.com> <476E236A.9000800@qumranet.com> <20071223012618.e8cf8320.akpm@linux-foundation.org> <476E39F2.4030202@qumranet.com> <20071223025245.d839c86d.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm-devel , Matt Mackall To: Andrew Morton Return-path: In-Reply-To: <20071223025245.d839c86d.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Andrew Morton wrote: > On Sun, 23 Dec 2007 12:35:30 +0200 Avi Kivity wrote: > > >> Andrew Morton wrote: >> >>> On Sun, 23 Dec 2007 10:59:22 +0200 Avi Kivity wrote: >>> >>> >>> >>>> Avi Kivity wrote: >>>> >>>> >>>>> Avi Kivity wrote: >>>>> >>>>> >>>>> >>>>>> Exactly. But it is better to be explicit about it and pass the page >>>>>> directly like you did before. I hate to make you go back-and-fourth, >>>>>> but I did not understand the issue completely before. >>>>>> >>>>>> >>>>>> >>>>>> >>>>> btw, the call to gfn_to_page() can happen in page_fault() instead of >>>>> walk_addr(); that will reduce the amount of error handling, and will >>>>> simplify the callers to walk_addr() that don't need the page. >>>>> >>>>> >>>>> >>>>> >>>> Note further that all this doesn't obviate the need for follow_page() >>>> (or get_user_pages_inatomic()); we still need something in update_pte() >>>> for the demand paging case. >>>> >>>> >>> Please review -mm's mm/pagewalk.c for suitability. >>> >>> If is is unsuitable but repairable then please cc Matt Mackall >>> on the review. >>> >>> >>> >> The "no locks are taken" comment is very worrying. We need accurate >> results. >> > > take down_read(mm->mmap_sem) before calling it.. > > You have to do that anyway for its results to be meaningful in the caller. > Ditto get_user_pages(). > > Yes, but what about the page table locks? follow_page() is much more thorough. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/