]> 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)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 4 Jan 2023 20:59:26 +0000 (15:59 -0500)
commit6c2c49f9b3f2ef85ba1b3c93e830fdbb3feeef1e
treed504846e65d7f1726c1f3f5f007546fb648693b1
parent151bbaa9595f514c0cc9e720e979009c147b0357
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