On Wed, 2014-07-09 at 18:21 +0200, Joerg Roedel wrote: > On Tue, Jul 08, 2014 at 05:59:58PM -0400, j.glisse@xxxxxxxxx wrote: > > +int mmput_register_notifier(struct notifier_block *nb) > > +{ > > + return blocking_notifier_chain_register(&mmput_notifier, nb); > > +} > > +EXPORT_SYMBOL_GPL(mmput_register_notifier); > > + > > +int mmput_unregister_notifier(struct notifier_block *nb) > > +{ > > + return blocking_notifier_chain_unregister(&mmput_notifier, nb); > > +} > > +EXPORT_SYMBOL_GPL(mmput_unregister_notifier); > > I am still not convinced that this is required. For core code that > needs > to hook into mmput (like aio or uprobes) it really improves code > readability if their teardown functions are called explicitly in > mmput. > > And drivers that deal with the mm can use the already existing > mmu_notifers. That works at least for the AMD-IOMMUv2 and KFD > drivers. > > Maybe HMM is different here, but then you should explain why and how > it > is different and why you can't add an explicit teardown function for > HMM. > > > Joerg > > Joerg, It's true I'm using the callback from AMD-IOMMUv2 when it is called from the release notifier, but I only use that to destroy queues that are related to the pasid that is being unbound. KFD driver still needs either this patch, or an explicit call to kfd_process_exit from mmput to release kfd_process object, which can't be released in the callback. I went for the explicit call but Andrew Morton said that this begs for converting into notifier chain. Jerome and I followed his advice and hence this patch. Oded��.n������g����a����&ޖ)���)��h���&������梷�����Ǟ�m������)������^�����������v���O��zf������