Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764458AbYBAB5k (ORCPT ); Thu, 31 Jan 2008 20:57:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753713AbYBAB5c (ORCPT ); Thu, 31 Jan 2008 20:57:32 -0500 Received: from relay2.sgi.com ([192.48.171.30]:52651 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752988AbYBAB5b (ORCPT ); Thu, 31 Jan 2008 20:57:31 -0500 Date: Thu, 31 Jan 2008 17:57:25 -0800 (PST) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Andrea Arcangeli cc: Robin Holt , Avi Kivity , Izik Eidus , kvm-devel@lists.sourceforge.net, Peter Zijlstra , steiner@sgi.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, daniel.blueman@quadrics.com Subject: mmu_notifier: invalidate_range for move_page_tables In-Reply-To: <20080201001355.GU7185@v2.random> Message-ID: References: <20080131045750.855008281@sgi.com> <20080131045812.785269387@sgi.com> <20080131123118.GK7185@v2.random> <20080201001355.GU7185@v2.random> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1737 Lines: 49 mmu_notifier: Provide invalidate_range for move_page_tables Move page tables also needs to invalidate the external references and hold new references off while moving page table entries. This is already guaranteed by holding a writelock on mmap_sem for get_user_pages() but follow_page() is not subject to the mmap_sem locking. Signed-off-by: Christoph Lameter --- mm/mremap.c | 4 ++++ 1 file changed, 4 insertions(+) Index: linux-2.6/mm/mremap.c =================================================================== --- linux-2.6.orig/mm/mremap.c 2008-01-25 14:25:31.000000000 -0800 +++ linux-2.6/mm/mremap.c 2008-01-31 17:54:19.000000000 -0800 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -130,6 +131,8 @@ unsigned long move_page_tables(struct vm old_end = old_addr + len; flush_cache_range(vma, old_addr, old_end); + mmu_notifier(invalidate_range_begin, vma->vm_mm, + old_addr, old_addr + len, 0); for (; old_addr < old_end; old_addr += extent, new_addr += extent) { cond_resched(); next = (old_addr + PMD_SIZE) & PMD_MASK; @@ -150,6 +153,7 @@ unsigned long move_page_tables(struct vm move_ptes(vma, old_pmd, old_addr, old_addr + extent, new_vma, new_pmd, new_addr); } + mmu_notifier(invalidate_range_end, vma->vm_mm, 0); return len + old_addr - old_end; /* how much done */ } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/