All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-fall-back-to-mmap_lock-if-vma-anon_vma-is-not-yet-set.patch removed from -mm tree
@ 2023-04-06  3:03 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-04-06  3:03 UTC (permalink / raw)
  To: mm-commits, 42.hyeyoo, surenb, akpm


The quilt patch titled
     Subject: mm: fall back to mmap_lock if vma->anon_vma is not yet set
has been removed from the -mm tree.  Its filename was
     mm-fall-back-to-mmap_lock-if-vma-anon_vma-is-not-yet-set.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Suren Baghdasaryan <surenb@google.com>
Subject: mm: fall back to mmap_lock if vma->anon_vma is not yet set
Date: Mon, 27 Feb 2023 09:36:23 -0800

When vma->anon_vma is not set, page fault handler will set it by either
reusing anon_vma of an adjacent VMA if VMAs are compatible or by
allocating a new one.  find_mergeable_anon_vma() walks VMA tree to find a
compatible adjacent VMA and that requires not only the faulting VMA to be
stable but also the tree structure and other VMAs inside that tree. 
Therefore locking just the faulting VMA is not enough for this search. 
Fall back to taking mmap_lock when vma->anon_vma is not set.  This
situation happens only on the first page fault and should not affect
overall performance.

Link: https://lkml.kernel.org/r/20230227173632.3292573-25-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memory.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/mm/memory.c~mm-fall-back-to-mmap_lock-if-vma-anon_vma-is-not-yet-set
+++ a/mm/memory.c
@@ -5254,6 +5254,10 @@ retry:
 	if (!vma_is_anonymous(vma))
 		goto inval;
 
+	/* find_mergeable_anon_vma uses adjacent vmas which are not locked */
+	if (!vma->anon_vma)
+		goto inval;
+
 	if (!vma_start_read(vma))
 		goto inval;
 
_

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



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

only message in thread, other threads:[~2023-04-06  3:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-06  3:03 [merged mm-stable] mm-fall-back-to-mmap_lock-if-vma-anon_vma-is-not-yet-set.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.