Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1401608
| From | Oleg Nesterov <oleg@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() |
| Date | 2016-05-16 18:30 +0200 |
| Message-ID | <rztz4-TV-17@gated-at.bofh.it> (permalink) |
| References | <rzsCZ-hC-15@gated-at.bofh.it> <rzsCZ-hC-13@gated-at.bofh.it> <rzt62-rV-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 05/16, Andrea Arcangeli wrote:
>
> Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Oleg Nesterov <oleg@redhat.com> - 2016-05-16 17:30 +0200
Re: [PATCH 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Andrea Arcangeli <aarcange@redhat.com> - 2016-05-16 18:00 +0200
Re: [PATCH 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Oleg Nesterov <oleg@redhat.com> - 2016-05-16 18:30 +0200
[PATCH v2 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Oleg Nesterov <oleg@redhat.com> - 2016-05-16 19:30 +0200
Re: [PATCH v2 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Michal Hocko <mhocko@kernel.org> - 2016-05-17 17:40 +0200
Re: [PATCH v2 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Oleg Nesterov <oleg@redhat.com> - 2016-05-17 18:40 +0200
Re: [PATCH v2 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Michal Hocko <mhocko@kernel.org> - 2016-05-17 22:40 +0200
csiph-web