From: Matthew Wilcox <willy@infradead.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jann Horn <jannh@google.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Suren Baghdasaryan <surenb@google.com>
Subject: Re: linux-next: manual merge of the mm tree with Linus' tree
Date: Fri, 28 Jul 2023 04:13:30 +0100 [thread overview]
Message-ID: <ZMMyWmyC8EvFIL/G@casper.infradead.org> (raw)
In-Reply-To: <20230728100047.4f9cd375@canb.auug.org.au>
On Fri, Jul 28, 2023 at 10:00:47AM +1000, Stephen Rothwell wrote:
> I have gone with below. Again, please check.
LGTM
> diff --cc mm/memory.c
> index ca632b58f792,271982fab2b8..000000000000
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@@ -5392,32 -5597,18 +5597,21 @@@ retry
> if (!vma)
> goto inval;
>
> - /* Only anonymous and tcp vmas are supported for now */
> - if (!vma_is_anonymous(vma) && !vma_is_tcp(vma))
> - /* find_mergeable_anon_vma uses adjacent vmas which are not locked */
> - if (vma_is_anonymous(vma) && !vma->anon_vma)
> -- goto inval;
> --
> if (!vma_start_read(vma))
> goto inval;
>
> + /*
> + * find_mergeable_anon_vma uses adjacent vmas which are not locked.
> + * This check must happen after vma_start_read(); otherwise, a
> + * concurrent mremap() with MREMAP_DONTUNMAP could dissociate the VMA
> + * from its anon_vma.
> + */
> - if (unlikely(!vma->anon_vma && !vma_is_tcp(vma)))
> - goto inval_end_read;
> -
> - /*
> - * Due to the possibility of userfault handler dropping mmap_lock, avoid
> - * it for now and fall back to page fault handling under mmap_lock.
> - */
> - if (userfaultfd_armed(vma))
> ++ if (unlikely(vma_is_anonymous(vma) && !vma->anon_vma))
> + goto inval_end_read;
> +
> /* Check since vm_start/vm_end might change before we lock the VMA */
> - if (unlikely(address < vma->vm_start || address >= vma->vm_end)) {
> - vma_end_read(vma);
> - goto inval;
> - }
> + if (unlikely(address < vma->vm_start || address >= vma->vm_end))
> + goto inval_end_read;
>
> /* Check if the VMA got isolated after we found it */
> if (vma->detached) {
If Andrew wants to rebase on Linus' tree, I'll be happy to respin
on top of that.
next prev parent reply other threads:[~2023-07-28 3:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 23:18 linux-next: manual merge of the mm tree with Linus' tree Stephen Rothwell
2023-07-27 23:29 ` Stephen Rothwell
2023-07-27 23:40 ` Suren Baghdasaryan
2023-07-27 23:50 ` Matthew Wilcox
2023-07-28 0:08 ` Suren Baghdasaryan
2023-07-28 0:00 ` Stephen Rothwell
2023-07-28 3:13 ` Matthew Wilcox [this message]
2023-07-27 23:49 ` Matthew Wilcox
2023-07-28 0:21 ` Stephen Rothwell
2023-07-28 0:23 ` Suren Baghdasaryan
2023-07-28 0:29 ` Stephen Rothwell
2023-07-28 0:30 ` Suren Baghdasaryan
-- strict thread matches above, loose matches on Subject: below --
2024-05-09 23:22 Stephen Rothwell
2023-07-06 22:54 Stephen Rothwell
2023-07-07 4:52 ` Baoquan He
2023-06-18 23:23 Stephen Rothwell
2023-06-19 20:25 ` Andrew Morton
2023-06-19 20:43 ` Will Deacon
2023-06-19 21:39 ` Andrew Morton
2023-06-20 9:43 ` Will Deacon
2023-06-20 15:00 ` Jain, Ayush
2023-02-24 23:39 Stephen Rothwell
2023-02-25 2:04 ` Andrew Morton
2023-02-25 7:13 ` Christian Brauner
2023-02-25 20:52 ` Andrew Morton
2023-02-27 10:18 ` Christian Brauner
2023-02-27 17:55 ` Andrew Morton
2022-11-07 2:52 Stephen Rothwell
2022-09-06 9:01 Stephen Rothwell
2022-09-06 9:21 ` Rolf Eike Beer
2022-05-26 6:09 Stephen Rothwell
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=ZMMyWmyC8EvFIL/G@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=surenb@google.com \
--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 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 read-only IMAP folder(s) and NNTP newsgroup(s).