From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 1/6] mmput: use notifier chain to call subsystem exit handler. Date: Tue, 1 Jul 2014 23:06:20 +0200 Message-ID: <20140701210620.GL26537@8bytes.org> References: <1403920822-14488-2-git-send-email-j.glisse@gmail.com> <019CCE693E457142B37B791721487FD91806B836@storexdag01.amd.com> <20140630154042.GD26537@8bytes.org> <20140630160604.GF1956@gmail.com> <20140630181623.GE26537@8bytes.org> <20140630183556.GB3280@gmail.com> <20140701091535.GF26537@8bytes.org> <019CCE693E457142B37B791721487FD91806DD8B@storexdag01.amd.com> <20140701110018.GH26537@8bytes.org> <20140701193343.GB3322@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20140701193343.GB3322-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Jerome Glisse Cc: Sherry Cheung , "linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org" , "Gabbay, Oded" , "hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org" , "aarcange-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , Jatin Kumar , Lucien Dunning , "mgorman-l3A5Bk7waGM@public.gmane.org" , "jweiner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , Subhash Gutti , "riel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "Bridgman, John" , John Hubbard , Mark Hairgrove , Cameron Buschardt , "peterz-hDdKplPs4pWWVfeAwA7xHQ@public.gmane.org" , Duncan Poole , "Cornwall, Jay" , "Lewycky, Andrew" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" List-Id: linux-mm.kvack.org On Tue, Jul 01, 2014 at 03:33:44PM -0400, Jerome Glisse wrote: > On Tue, Jul 01, 2014 at 01:00:18PM +0200, Joerg Roedel wrote: > > No, its not in this case. The file descriptor is used to connect a > > process address space with a device context. Thus without the mappings > > the file-descriptor is useless and the mappings should stay in-tact > > until the fd is closed. > > > > It would be a very bad semantic for userspace if a fd that is passed on > > fails on the other side because the sending process died. > > Consider use case where there is no file associated with the mmu_notifier > ie there is no device file descriptor that could hold and take care of > mmu_notifier destruction and cleanup. We need this call chain for this > case. Example of such a use-case where no fd will be associated? Anyway, even without an fd, there will always be something that sets the mm->device binding up (calling mmu_notifier_register) and tears it down in the end (calling mmu_notifier_unregister). And this will be the places where any resources left from the .release call-back can be cleaned up. Joerg