From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, peterx@redhat.com, surenb@google.com,
akpm@linux-foundation.org
Subject: [merged mm-stable] mm-prevent-userfaults-to-be-handled-under-per-vma-lock.patch removed from -mm tree
Date: Wed, 05 Apr 2023 20:03:53 -0700 [thread overview]
Message-ID: <20230406030353.C74BEC433EF@smtp.kernel.org> (raw)
The quilt patch titled
Subject: mm: prevent userfaults to be handled under per-vma lock
has been removed from the -mm tree. Its filename was
mm-prevent-userfaults-to-be-handled-under-per-vma-lock.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: prevent userfaults to be handled under per-vma lock
Date: Mon, 27 Feb 2023 09:36:26 -0800
Due to the possibility of handle_userfault dropping mmap_lock, avoid fault
handling under VMA lock and retry holding mmap_lock. This can be handled
more gracefully in the future.
Link: https://lkml.kernel.org/r/20230227173632.3292573-28-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Suggested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memory.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/mm/memory.c~mm-prevent-userfaults-to-be-handled-under-per-vma-lock
+++ a/mm/memory.c
@@ -5266,6 +5266,15 @@ retry:
if (!vma_start_read(vma))
goto inval;
+ /*
+ * 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)) {
+ vma_end_read(vma);
+ goto inval;
+ }
+
/* 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);
_
Patches currently in -mm which might be from surenb@google.com are
reply other threads:[~2023-04-06 3:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230406030353.C74BEC433EF@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=peterx@redhat.com \
--cc=surenb@google.com \
/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 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.