From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.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>
Subject: linux-next: manual merge of the mm tree with Linus' tree
Date: Mon, 19 Jun 2023 09:23:55 +1000 [thread overview]
Message-ID: <20230619092355.133c5cdb@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 2810 bytes --]
Hi all,
Today's linux-next merge of the mm tree got a conflict in:
mm/mmap.c
between commit:
606c812eb1d5 ("mm/mmap: Fix error path in do_vmi_align_munmap()")
from the origin tree and commits:
66106c364147 ("mm: change do_vmi_align_munmap() side tree index")
47b1d8de18f5 ("mm/mmap: change vma iteration order in do_vmi_align_munmap()")
from the mm tree.
I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging. You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc mm/mmap.c
index 98cda6f72605,474a0d856622..000000000000
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@@ -2398,15 -2409,27 +2396,29 @@@ do_vmi_align_munmap(struct vma_iterato
if (error)
goto end_split_failed;
}
- mas_set(&mas_detach, count);
- error = munmap_sidetree(next, &mas_detach);
- if (error)
- goto munmap_sidetree_failed;
+ vma_start_write(next);
- mas_set_range(&mas_detach, next->vm_start, next->vm_end - 1);
+ if (mas_store_gfp(&mas_detach, next, GFP_KERNEL))
+ goto munmap_gather_failed;
+ vma_mark_detached(next, true);
+ if (next->vm_flags & VM_LOCKED)
+ locked_vm += vma_pages(next);
count++;
+ if (unlikely(uf)) {
+ /*
+ * If userfaultfd_unmap_prep returns an error the vmas
+ * will remain split, but userland will get a
+ * highly unexpected error anyway. This is no
+ * different than the case where the first of the two
+ * __split_vma fails, but we don't undo the first
+ * split, despite we could. This is unlikely enough
+ * failure that it's not worth optimizing it for.
+ */
+ error = userfaultfd_unmap_prep(next, start, end, uf);
+
+ if (error)
+ goto userfaultfd_error;
+ }
#ifdef CONFIG_DEBUG_VM_MAPLE_TREE
BUG_ON(next->vm_start < start);
BUG_ON(next->vm_start > end);
@@@ -2454,14 -2455,18 +2444,20 @@@
BUG_ON(count != test_count);
}
#endif
- /* Point of no return */
+ error = -ENOMEM;
- vma_iter_set(vmi, start);
+ while (vma_iter_addr(vmi) > start)
+ vma_iter_prev_range(vmi);
+
if (vma_iter_clear_gfp(vmi, start, end, GFP_KERNEL))
- return -ENOMEM;
+ goto clear_tree_failed;
+ mm->locked_vm -= locked_vm;
mm->map_count -= count;
+ prev = vma_iter_prev_range(vmi);
+ next = vma_next(vmi);
+ if (next)
+ vma_iter_prev_range(vmi);
+
/*
* Do not downgrade mmap_lock if we are next to VM_GROWSDOWN or
* VM_GROWSUP VMA. Such VMAs can change their size under
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2023-06-18 23:24 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-18 23:23 Stephen Rothwell [this message]
2023-06-19 20:25 ` linux-next: manual merge of the mm tree with Linus' tree 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
-- strict thread matches above, loose matches on Subject: below --
2025-02-09 22:39 Stephen Rothwell
2024-09-29 23:56 Stephen Rothwell
2024-09-30 6:01 ` Miguel Ojeda
2024-09-16 23:27 Stephen Rothwell
2024-09-17 23:40 ` Stephen Rothwell
2024-09-09 0:00 Stephen Rothwell
2024-09-09 1:53 ` Huang, Ying
2024-09-17 23:36 ` Stephen Rothwell
2024-07-28 22:41 Stephen Rothwell
2024-07-28 22:45 ` Stephen Rothwell
2024-07-28 23:31 ` Andrew Morton
2024-05-09 23:22 Stephen Rothwell
2023-07-27 23:18 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
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
2023-07-06 22:54 Stephen Rothwell
2023-07-07 4:52 ` Baoquan He
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=20230619092355.133c5cdb@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox