From mboxrd@z Thu Jan 1 00:00:00 1970 From: KOSAKI Motohiro Subject: Re: [RFC][PATCH v3 1/6] mm: Don't unmap gup()ed page Date: Wed, 15 Apr 2009 20:39:04 +0900 Message-ID: <2f11576a0904150439k6e828307ja97b6729650bcb94@mail.gmail.com> References: <20090414143252.GE28265@random.random> <200904150042.15653.nickpiggin@yahoo.com.au> <20090415165431.AC4C.A69D9226@jp.fujitsu.com> <20090415104615.GG9809@random.random> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nick Piggin , LKML , Linus Torvalds , Andrew Morton , Jeff Moyer , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Hugh Dickins To: Andrea Arcangeli Return-path: Received: from rv-out-0506.google.com ([209.85.198.234]:59523 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758862AbZDOLjF convert rfc822-to-8bit (ORCPT ); Wed, 15 Apr 2009 07:39:05 -0400 In-Reply-To: <20090415104615.GG9809@random.random> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: >> + =A0 =A0 if (!migration) { >> + =A0 =A0 =A0 =A0 =A0 =A0 /* re-check */ >> + =A0 =A0 =A0 =A0 =A0 =A0 if (PageSwapCache(page) && >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 page_count(page) !=3D page_mapcoun= t(page) + 2) { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* We lose race against ge= t_user_pages_fast() */ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 set_pte_at(mm, address, pt= e, pteval); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D SWAP_FAIL; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out_unmap; >> + =A0 =A0 =A0 =A0 =A0 =A0 } >> + =A0 =A0 } >> + =A0 =A0 mmu_notifier_invalidate_page(vma->vm_mm, address); > > With regard to mmu notifier, this is the opposite of the right > ordering. One mmu_notifier_invalidate_page must run _before_ the firs= t > check. The ptep_clear_flush_notify will then stay and there's no need > of a further mmu_notifier_invalidate_page after the second check. OK. but I have one question. Can we assume mmu_notifier is only used by kvm now? if not, we need to make new notifier. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html