All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-start-tracking-vmas-with-maple-tree-fix.patch added to mm-unstable branch
@ 2022-05-10 17:52 Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2022-05-10 17:52 UTC (permalink / raw)
  To: mm-commits, sfr, Liam.Howlett, akpm, akpm


The patch titled
     Subject: mapletree: build fix
has been added to the -mm mm-unstable branch.  Its filename is
     mm-start-tracking-vmas-with-maple-tree-fix.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-start-tracking-vmas-with-maple-tree-fix.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: mapletree: build fix

Fix the vma_mas_store/vma_mas_remove issues.  Missing prototypes, missing
implementation on nommu.

Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/mm.h |    3 +++
 mm/mmap.c          |    4 ++--
 mm/nommu.c         |   13 +++++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

--- a/include/linux/mm.h~mm-start-tracking-vmas-with-maple-tree-fix
+++ a/include/linux/mm.h
@@ -2641,6 +2641,9 @@ extern struct vm_area_struct *copy_vma(s
 	bool *need_rmap_locks);
 extern void exit_mmap(struct mm_struct *);
 
+void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas);
+void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas);
+
 static inline int check_data_rlimit(unsigned long rlim,
 				    unsigned long new,
 				    unsigned long start,
--- a/mm/mmap.c~mm-start-tracking-vmas-with-maple-tree-fix
+++ a/mm/mmap.c
@@ -754,7 +754,7 @@ static void __vma_link_file(struct vm_ar
  *
  * Note: the end address is inclusive in the maple tree.
  */
-inline void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas)
+void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas)
 {
 	trace_vma_store(mas->tree, vma);
 	mas_set_range(mas, vma->vm_start, vma->vm_end - 1);
@@ -770,7 +770,7 @@ inline void vma_mas_store(struct vm_area
  * been established and points to the correct location.
  * Note: the end address is inclusive in the maple tree.
  */
-static inline void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas)
+void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas)
 {
 	trace_vma_mas_szero(mas->tree, vma->vm_start, vma->vm_end - 1);
 	mas->index = vma->vm_start;
--- a/mm/nommu.c~mm-start-tracking-vmas-with-maple-tree-fix
+++ a/mm/nommu.c
@@ -545,6 +545,19 @@ static void put_nommu_region(struct vm_r
 	__put_nommu_region(region);
 }
 
+void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas)
+{
+	mas_set_range(mas, vma->vm_start, vma->vm_end - 1);
+	mas_store_prealloc(mas, vma);
+}
+
+void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas)
+{
+	mas->index = vma->vm_start;
+	mas->last = vma->vm_end - 1;
+	mas_store_prealloc(mas, NULL);
+}
+
 /*
  * add a VMA into a process's mm_struct in the appropriate place in the list
  * and tree and add to the address space's page tree also if not an anonymous
_

Patches currently in -mm which might be from akpm@linux-foundation.org are

mm-check-against-orig_pte-for-finish_fault-fix-checkpatch-fixes.patch
mm-hugetlb-only-drop-uffd-wp-special-pte-if-required-fix-fix.patch
lib-kstrtoxc-add-false-true-support-to-kstrtobool-fix.patch
mm-start-tracking-vmas-with-maple-tree-fix.patch
linux-next-rejects.patch
linux-next-git-rejects.patch
mm-oom_killc-fix-vm_oom_kill_table-ifdeffery.patch


^ permalink raw reply	[flat|nested] 3+ messages in thread

* + mm-start-tracking-vmas-with-maple-tree-fix.patch added to mm-unstable branch
@ 2022-07-19 19:04 Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2022-07-19 19:04 UTC (permalink / raw)
  To: mm-commits, Liam.Howlett, hughd, liam.howlett, akpm


The patch titled
     Subject: mmap: remove unroll from __vma_adjust()
has been added to the -mm mm-unstable branch.  Its filename is
     mm-start-tracking-vmas-with-maple-tree-fix.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-start-tracking-vmas-with-maple-tree-fix.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Liam Howlett <liam.howlett@oracle.com>
Subject: mmap: remove unroll from __vma_adjust()
Date: Tue, 19 Jul 2022 18:49:48 +0000

If __vma_adjust() fails, then there is no reason to undo the anon vma work
since it will be done in the caller or we have been OOMed.

Link: https://lkml.kernel.org/r/20220719184938.3359932-1-Liam.Howlett@oracle.com
Fixes: 83651ef5048d (mm: start tracking VMAs with maple tree)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Suggested-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/mmap.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

--- a/mm/mmap.c~mm-start-tracking-vmas-with-maple-tree-fix
+++ a/mm/mmap.c
@@ -923,12 +923,8 @@ int __vma_adjust(struct vm_area_struct *
 		}
 	}
 	vma_adjust_trans_huge(orig_vma, start, end, adjust_next);
-
-	if (mas_preallocate(&mas, vma, GFP_KERNEL)) {
-		if (exporter && exporter->anon_vma)
-			unlink_anon_vmas(importer);
+	if (mas_preallocate(&mas, vma, GFP_KERNEL))
 		return -ENOMEM;
-	}
 
 	if (file) {
 		mapping = file->f_mapping;
_

Patches currently in -mm which might be from liam.howlett@oracle.com are

android-binder-fix-lockdep-check-on-clearing-vma.patch
maple-tree-add-new-data-structure-fix.patch
mm-start-tracking-vmas-with-maple-tree-fix.patch
mm-mmap-use-advanced-maple-tree-api-for-mmap_region-fix.patch
mm-mlock-drop-dead-code-in-count_mm_mlocked_page_nr.patch


^ permalink raw reply	[flat|nested] 3+ messages in thread

* + mm-start-tracking-vmas-with-maple-tree-fix.patch added to mm-unstable branch
@ 2022-06-29 22:30 Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2022-06-29 22:30 UTC (permalink / raw)
  To: mm-commits, Liam.Howlett, akpm


The patch titled
     Subject: mm/mmap: reorder validate_mm_mt() checks
has been added to the -mm mm-unstable branch.  Its filename is
     mm-start-tracking-vmas-with-maple-tree-fix.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-start-tracking-vmas-with-maple-tree-fix.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Subject: mm/mmap: reorder validate_mm_mt() checks
Date: Tue, 28 Jun 2022 15:08:19 -0400

Allows for detecting broken trees before attempting to iterate over the tree.

Link: https://lkml.kernel.org/r/20220629153127.p2k2cqkc7qy7f3vw@revolver
Fixes: de4583ed958b (mm: start tracking VMAs with maple tree)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/mmap.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/mm/mmap.c~mm-start-tracking-vmas-with-maple-tree-fix
+++ a/mm/mmap.c
@@ -392,6 +392,8 @@ static void validate_mm_mt(struct mm_str
 	struct vm_area_struct *vma_mt, *vma = mm->mmap;
 
 	MA_STATE(mas, mt, 0, 0);
+
+	mt_validate(&mm->mm_mt);
 	mas_for_each(&mas, vma_mt, ULONG_MAX) {
 		if (xa_is_zero(vma_mt))
 			continue;
@@ -440,7 +442,6 @@ static void validate_mm_mt(struct mm_str
 
 	}
 	VM_BUG_ON(vma);
-	mt_validate(&mm->mm_mt);
 }
 #else
 #define validate_mm_mt(root) do { } while (0)
_

Patches currently in -mm which might be from Liam.Howlett@oracle.com are

android-binder-stop-saving-a-pointer-to-the-vma.patch
mm-start-tracking-vmas-with-maple-tree-fix.patch


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-19 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 17:52 + mm-start-tracking-vmas-with-maple-tree-fix.patch added to mm-unstable branch Andrew Morton
2022-06-29 22:30 Andrew Morton
2022-07-19 19:04 Andrew Morton

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.