All of lore.kernel.org
 help / color / mirror / Atom feed
* [folded-merged] mm-vmscan-use-vma-iterator-instead-of-vm_next-fix.patch removed from -mm tree
@ 2022-09-26 21:01 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-09-26 21:01 UTC (permalink / raw)
  To: mm-commits, liam.howlett, yuzhao, akpm


The quilt patch titled
     Subject: mm/vmscan: use the proper VMA iterator
has been removed from the -mm tree.  Its filename was
     mm-vmscan-use-vma-iterator-instead-of-vm_next-fix.patch

This patch was dropped because it was folded into mm-vmscan-use-vma-iterator-instead-of-vm_next.patch

------------------------------------------------------
From: Yu Zhao <yuzhao@google.com>
Subject: mm/vmscan: use the proper VMA iterator
Date: Mon, 12 Sep 2022 14:01:28 -0600

When get_next_vma() finishes iterating VMAs within a range [start, end),
it expects args->vma to point the first VMA out of that range, if such a
VMA exists.  This allows its callers to continue the iteration with a new
range above the previous one, if those callers choose to.

for_each_vma_range() always sets args->vma to NULL after it's done.  This
may mislead those callers to conclude that there are no more VMAs, and in
turn they terminate their iterations prematurely.

This fix replaces for_each_vma_range() with for_each_vma() and explicitly
checks whether the next VMA is still within range, and if not, returns
false to indicate the current range has ended.  The callers may continue
with the next range if args->vma is not NULL.

Link: https://lkml.kernel.org/r/Yx+QGOgHg1Wk8tGK@google.com
Signed-off-by: Yu Zhao <yuzhao@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/vmscan.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/mm/vmscan.c~mm-vmscan-use-vma-iterator-instead-of-vm_next-fix
+++ a/mm/vmscan.c
@@ -3779,7 +3779,10 @@ static bool get_next_vma(unsigned long m
 	VM_WARN_ON_ONCE(mask & size);
 	VM_WARN_ON_ONCE((start & mask) != (*vm_start & mask));
 
-	for_each_vma_range(vmi, args->vma, end) {
+	for_each_vma(vmi, args->vma) {
+		if (end && end <= args->vma->vm_start)
+			return false;
+
 		if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args))
 			continue;
 
_

Patches currently in -mm which might be from yuzhao@google.com are

mm-x86-arm64-add-arch_has_hw_pte_young.patch
mm-x86-add-config_arch_has_nonleaf_pmd_young.patch
mm-vmscanc-refactor-shrink_node.patch
revert-include-linux-mm_inlineh-fold-__update_lru_size-into-its-sole-caller.patch
mm-multi-gen-lru-groundwork.patch
mm-multi-gen-lru-minimal-implementation.patch
mm-multi-gen-lru-exploit-locality-in-rmap.patch
mm-multi-gen-lru-support-page-table-walks.patch
mm-multi-gen-lru-optimize-multiple-memcgs.patch
mm-multi-gen-lru-kill-switch.patch
mm-multi-gen-lru-thrashing-prevention.patch
mm-multi-gen-lru-debugfs-interface.patch
mm-multi-gen-lru-admin-guide.patch
mm-multi-gen-lru-design-doc.patch
mm-vmscan-use-vma-iterator-instead-of-vm_next.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-26 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 21:01 [folded-merged] mm-vmscan-use-vma-iterator-instead-of-vm_next-fix.patch removed from -mm tree 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.