All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create()
Date: Mon, 16 May 2016 18:20:39 +0200	[thread overview]
Message-ID: <20160516162039.GA19459@redhat.com> (raw)
In-Reply-To: <20160516155729.GH550@redhat.com>

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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create()
Date: Mon, 16 May 2016 18:20:39 +0200	[thread overview]
Message-ID: <20160516162039.GA19459@redhat.com> (raw)
In-Reply-To: <20160516155729.GH550@redhat.com>

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.

  reply	other threads:[~2016-05-16 16:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16 15:25 [PATCH 0/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Oleg Nesterov
2016-05-16 15:25 ` Oleg Nesterov
2016-05-16 15:25 ` [PATCH 1/1] " Oleg Nesterov
2016-05-16 15:25   ` Oleg Nesterov
2016-05-16 15:57   ` Andrea Arcangeli
2016-05-16 15:57     ` Andrea Arcangeli
2016-05-16 16:20     ` Oleg Nesterov [this message]
2016-05-16 16:20       ` Oleg Nesterov
2016-05-16 17:22   ` [PATCH v2 " Oleg Nesterov
2016-05-16 17:22     ` Oleg Nesterov
2016-05-17 15:33     ` Michal Hocko
2016-05-17 15:33       ` Michal Hocko
2016-05-17 16:30       ` Oleg Nesterov
2016-05-17 16:30         ` Oleg Nesterov
2016-05-17 20:34         ` Michal Hocko
2016-05-17 20:34           ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160516162039.GA19459@redhat.com \
    --to=oleg@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.