From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Steiner Subject: Re: [patch 1/3] mmu_notifier: Core code Date: Thu, 31 Jan 2008 21:01:05 -0600 Message-ID: <20080201030104.GA29417@sgi.com> References: <20080131045750.855008281@sgi.com> <20080131045812.553249048@sgi.com> <20080201023113.GB26420@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Andrea Arcangeli , Peter Zijlstra , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@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 To: Christoph Lameter Return-path: Content-Disposition: inline In-Reply-To: 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 Thu, Jan 31, 2008 at 06:39:19PM -0800, Christoph Lameter wrote: > On Thu, 31 Jan 2008, Robin Holt wrote: > > > Jack has repeatedly pointed out needing an unregister outside the > > mmap_sem. I still don't see the benefit to not having the lock in the mm. > > I never understood why this would be needed. ->release removes the > mmu_notifier right now. Christoph - We discussed this earlier this week. Here is part of the mail: ------------ > > There currently is no __mmu_notifier_unregister(). Oversite??? > > No need. mmu_notifier_release implies an unregister and I think that is > the most favored way to release resources since it deals with the RCU > quiescent period. I currently unlink the mmu_notifier when the last GRU mapping is closed. For example, if a user does a: gru_create_context(); ... gru_destroy_context(); the mmu_notifier is unlinked and all task tables allocated by the driver are freed. Are you suggesting that I leave tables allocated until the task terminates?? Why is that better? What problem do I cause by trying to free tables as soon as they are not needed? ----------------------------------------------- > Christoph responded: > > the mmu_notifier is unlinked and all task tables allocated > > by the driver are freed. Are you suggesting that I leave tables > > allocated until the task terminates?? > > You need to leave the mmu_notifier structure allocated until the next > quiescent rcu period unless you use the release notifier. I assumed that I would need to use call_rcu() or synchronize_rcu() before the table is actually freed. That's still on my TODO list. --- jack ------------------------------------------------------------------------- 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/