From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: [patch 6/6] mmu_notifier: Add invalidate_all() Date: Mon, 28 Jan 2008 12:28:46 -0800 Message-ID: <20080128202924.810792591@sgi.com> References: <20080128202840.974253868@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline; filename=mmu_all 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 To: Andrea Arcangeli Cc: Nick Piggin , Peter Zijlstra , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Benjamin Herrenschmidt , steiner-sJ/iWh9BUns@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Avi Kivity , kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, daniel.blueman-xqY44rlHlBpWk0Htik3J/w@public.gmane.org, Robin Holt , Hugh Dickins List-Id: linux-mm.kvack.org when a task exits we can remove all external pts at once. At that point the extern mmu may also unregister itself from the mmu notifier chain to avoid future calls. Note the complications because of RCU. Other processors may not see that the notifier was unlinked until a quiescent period has passed! Signed-off-by: Christoph Lameter --- include/linux/mmu_notifier.h | 4 ++++ mm/mmap.c | 1 + 2 files changed, 5 insertions(+) Index: linux-2.6/include/linux/mmu_notifier.h =================================================================== --- linux-2.6.orig/include/linux/mmu_notifier.h 2008-01-28 11:43:03.000000000 -0800 +++ linux-2.6/include/linux/mmu_notifier.h 2008-01-28 12:21:33.000000000 -0800 @@ -62,6 +62,10 @@ struct mmu_notifier_ops { struct mm_struct *mm, unsigned long address); + /* Dummy needed because the mmu_notifier() macro requires it */ + void (*invalidate_all)(struct mmu_notifier *mn, struct mm_struct *mm, + int dummy); + /* * lock indicates that the function is called under spinlock. */ Index: linux-2.6/mm/mmap.c =================================================================== --- linux-2.6.orig/mm/mmap.c 2008-01-28 11:47:53.000000000 -0800 +++ linux-2.6/mm/mmap.c 2008-01-28 11:57:45.000000000 -0800 @@ -2034,6 +2034,7 @@ void exit_mmap(struct mm_struct *mm) unsigned long end; /* mm's last user has gone, and its about to be pulled down */ + mmu_notifier(invalidate_all, mm, 0); arch_exit_mmap(mm); lru_add_drain(); -- ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/