linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Brian Geffon <bgeffon@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	 LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	 Andrea Arcangeli <aarcange@redhat.com>,
	Sonny Rao <sonnyrao@google.com>,
	 Minchan Kim <minchan@kernel.org>,
	"Kirill A . Shutemov" <kirill@shutemov.name>
Subject: Re: [PATCH] userfaultfd: fix remap event with MREMAP_DONTUNMAP.
Date: Wed, 6 May 2020 21:35:10 -0400	[thread overview]
Message-ID: <CAEXW_YT34g6aypdia0AsXGQ1MxGtD9=DF=mpAwKWaLM6JuSpcQ@mail.gmail.com> (raw)
In-Reply-To: <CADyq12wW-j9vi0oxXB_+sjSyP=FgaNWkRM2Yo9YqkEwGnOb0bA@mail.gmail.com>

On Wed, May 6, 2020 at 9:11 PM Brian Geffon <bgeffon@google.com> wrote:
>
> > > -       mremap_userfaultfd_complete(&uf, addr, new_addr, old_len);
> > > +       mremap_userfaultfd_complete(&uf, addr, ret, old_len);
> >
> > Not super familiar with this code, but thought I'd ask, does ret
> > to be checked for -ENOMEM before calling mremap_userfaultfd_complete?
> > Sorry if I missed something.
>
> No, mremap_userfaultfd_complete will do a check similar to
> offset_in_page() by checking the page mask.
> It does (to & ~PAGE_MASK) to check for a non-aligned "to" value, so we're good.
>
> Additionally, earlier in the process then ctx will be null because we
> will have never called mremap_userfaultfd_prep,
> and mremap_userfaultfd_complete will check if there is a context
> before proceeding.

Makes sense.

thanks,

 - Joel


      reply	other threads:[~2020-05-07  1:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 17:21 [PATCH] userfaultfd: fix remap event with MREMAP_DONTUNMAP Brian Geffon
2020-05-06 17:28 ` Joel Fernandes
2020-05-06 17:32   ` Brian Geffon
2020-05-07  0:55     ` Joel Fernandes
2020-05-07  1:06 ` Joel Fernandes
2020-05-07  1:11   ` Brian Geffon
2020-05-07  1:35     ` Joel Fernandes [this message]

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='CAEXW_YT34g6aypdia0AsXGQ1MxGtD9=DF=mpAwKWaLM6JuSpcQ@mail.gmail.com' \
    --to=joel@joelfernandes.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bgeffon@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=mst@redhat.com \
    --cc=sonnyrao@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).