Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759720AbYA3Xzw (ORCPT ); Wed, 30 Jan 2008 18:55:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752454AbYA3Xzp (ORCPT ); Wed, 30 Jan 2008 18:55:45 -0500 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:59918 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753851AbYA3Xzo (ORCPT ); Wed, 30 Jan 2008 18:55:44 -0500 Date: Wed, 30 Jan 2008 15:55:37 -0800 (PST) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Andrea Arcangeli cc: Robin Holt , Jack Steiner , Avi Kivity , Izik Eidus , Nick Piggin , kvm-devel@lists.sourceforge.net, Benjamin Herrenschmidt , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-mm@kvack.org, daniel.blueman@quadrics.com, Hugh Dickins Subject: Re: [patch 1/6] mmu_notifier: Core code In-Reply-To: <20080130233803.GB7185@v2.random> Message-ID: References: <20080130022909.677301714@sgi.com> <20080130022944.236370194@sgi.com> <20080130153749.GN7233@v2.random> <20080130155306.GA13746@sgi.com> <20080130222035.GX26420@sgi.com> <20080130233803.GB7185@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: 1791 Lines: 37 On Thu, 31 Jan 2008, Andrea Arcangeli wrote: > > I think Andrea's original concept of the lock in the mmu_notifier_head > > structure was the best. I agree with him that it should be a spinlock > > instead of the rw_lock. > > BTW, I don't see the scalability concern with huge number of tasks: > the lock is still in the mm, down_write(mm->mmap_sem); oneinstruction; > up_write(mm->mmap_sem) is always going to scale worse than > spin_lock(mm->somethingelse); oneinstruction; > spin_unlock(mm->somethinglese). If we put it elsewhere in the mm then we increase the size of the memory used in the mm_struct. > Furthermore if we go this route and we don't relay on implicit > serialization of all the mmu notifier users against exit_mmap > (i.e. the mmu notifier user must agree to stop calling > mmu_notifier_register on a mm after the last mmput) the autodisarming > feature will likely have to be removed or it can't possibly be safe to > run mmu_notifier_unregister while mmu_notifier_release runs. With the > auto-disarming feature, there is no way to safely know if > mmu_notifier_unregister has to be called or not. I'm ok with removing > the auto-disarming feature and to have as self-contained-as-possible > locking. Then mmu_notifier_release can just become the > invalidate_all_after and invalidate_all, invalidate_all_before. Hmmmm.. exit_mmap is only called when the last reference is removed against the mm right? So no tasks are running anymore. No pages are left. Do we need to serialize at all for mmu_notifier_release? -- 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/