From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: [patch 1/6] mmu_notifier: Core code Date: Tue, 29 Jan 2008 15:34:17 +0100 Message-ID: <20080129143417.GI7233@v2.random> References: <20080128202840.974253868@sgi.com> <20080128202923.609249585@sgi.com> <20080129135914.GF7233@v2.random> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 To: Christoph Lameter Return-path: Content-Disposition: inline In-Reply-To: <20080129135914.GF7233-lysg2Xt5kKMAvxtiuMwx3w@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 On Tue, Jan 29, 2008 at 02:59:14PM +0100, Andrea Arcangeli wrote: > The down_write is garbage. The caller should put it around > mmu_notifier_register if something. The same way the caller should > call synchronize_rcu after mmu_notifier_register if it needs > synchronous behavior from the notifiers. The default version of > mmu_notifier_register shouldn't be cluttered with unnecessary locking. Ooops my spinlock was gone from the notifier head.... so the above comment is wrong sorry! I thought down_write was needed to serialize against some _external_ event, not to serialize the list updates in place of my explicit lock. The critical section is so small that a semaphore is the wrong locking choice, that's why I assumed it was for an external event. Anyway RCU won't be optimal for a huge flood of register/unregister, I agree the down_write shouldn't create much contention and it saves 4 bytes from each mm_struct, and we can always change it to a proper spinlock later if needed. ------------------------------------------------------------------------- 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/