On 05/16, Andrea Arcangeli wrote: > > Reviewed-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> Thanks, > > +static inline bool userfaultfd_get_mm(struct userfaultfd_ctx *ctx) > > +{ > > + return atomic_inc_not_zero(&ctx->mm->mm_users); > > +} > > Nice cleanup, but wouldn't it be more generic to implement this as > mmget(&ctx->mm) (or maybe mmget_not_zero) in include/linux/mm.h > instead of userfaultfd.c, so then others can use it too, see: Yes, agreed. userfaultfd_get_mm() doesn't look as good as I initially thought. So I guess it would be better to make V2 right now, to avoid another change in userfaultfd.c which changes the same code. Except I think mmget_not_zero() should go to linux/sched.h, until we move mmdrop/mmput/etc to linux/mm.h. I'll send V2 soon... Oleg. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>