]> 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>
Mon, 27 Feb 2023 17:36:22 +0000 (09:36 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 28 Mar 2023 23:24:54 +0000 (16:24 -0700)
commitf5d69cd63bec4849e0370efc6fa070752f7a9836
treec4d7d2c9e5aece2d03cc8f577f1bdd4482d54617
parentce070be0fbf4e8ba95ecb2e43c6e667065669632
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.

Link: https://lkml.kernel.org/r/20230227173632.3292573-24-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm.h
mm/memory.c