mm: handle shared faults under the VMA lock
mainline inclusion from mainline-v6.7-rc1 commit 4ed4379881aa62588aba6442a9f362a8cf7624e6 category: other bugzilla: https://gitee.com/openeuler/kernel/issues/I8K7C7 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4ed4379881aa62588aba6442a9f362a8cf7624e6 -------------------------------- There are many implementations of ->fault and some of them depend on mmap_lock being held. All vm_ops that implement ->map_pages() end up calling filemap_fault(), which I have audited to be sure it does not rely on mmap_lock. So (for now) key off ->map_pages existing as a flag to indicate that it's safe to call ->fault while only holding the vma lock. Link: https://lkml.kernel.org/r/20231006195318.4087158-4-willy@infradead.org Signed-off-by:Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by:
Suren Baghdasaryan <surenb@google.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Tong Tiangen <tongtiangen@huawei.com>
Loading
Please sign in to comment