]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: introduce lock_vma_under_rcu to be used from arch-specific code
authorSuren Baghdasaryan <surenb@google.com>
Thu, 12 May 2022 22:03:53 +0000 (15:03 -0700)
committerSuren Baghdasaryan <surenb@google.com>
Wed, 23 Nov 2022 02:09:46 +0000 (02:09 +0000)
commit6f712845fed42e5dbaa586ade9f26d3cfda7892a
treefe14d2a71d9d998f1d10b74252ee2746d5d9baa2
parente611b0a9a274ab3f65647eafee410b5b6da56ea8
mm: introduce lock_vma_under_rcu to be used from arch-specific code

Introduce lock_vma_under_rcu function to lookup and lock a VMA during
page fault handling. When VMA is not found, can't be locked or changes
after being locked, the function returns NULL. The lookup is performed
under RCU protection to prevent the found VMA from being destroyed before
the VMA lock is acquired. VMA lock statistics are updated according to
the results.
For now only anonymous VMAs can be searched this way. In other cases the
function returns NULL.

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
include/linux/mm.h
mm/memory.c