On Tue, 8 Apr 2008, Andrea Arcangeli wrote: > + /* > + * Called when nobody can register any more notifier in the mm > + * and after the "mn" notifier has been disarmed already. > + */ > + void (*release)(struct mmu_notifier *mn, > + struct mm_struct *mm);
Hmmm... The unregister function does not call this. Guess driver calls unregister function and does release like stuff on its own. > + /* > + * invalidate_range_start() and invalidate_range_end() must be > + * paired. Multiple invalidate_range_start/ends may be nested > + * or called concurrently. > + */ How could they be nested or called concurrently? > +/* > + * mm_users can't go down to zero while mmu_notifier_unregister() > + * runs or it can race with ->release. So a mm_users pin must > + * be taken by the caller (if mm can be different from current->mm). > + */ > +int mmu_notifier_unregister(struct mmu_notifier *mn, struct mm_struct *mm) > +{ > + struct mm_lock_data *data; > + > + BUG_ON(!atomic_read(&mm->mm_users)); > + > + data = mm_lock(mm); > + if (unlikely(IS_ERR(data))) > + return PTR_ERR(data); > + hlist_del(&mn->hlist); > + mm_unlock(mm, data); > + return 0; Hmmm.. Ok, the user of the notifier does not get notified that it was unregistered. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel