]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/khugepaged: write-lock VMA while collapsing a huge page
authorSuren Baghdasaryan <surenb@google.com>
Sat, 11 Jun 2022 04:32:23 +0000 (21:32 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 4 Jan 2023 20:59:25 +0000 (15:59 -0500)
commita53ac71cadc27e7e6ef3cebc1670ca9e930840c4
tree2af8dada84b164d595daa91c501f528d0bce06dc
parent9bdfe600b9caf37a74f8dcbcfa4ad0022940cdb2
mm/khugepaged: write-lock VMA while collapsing a huge page

Protect VMA from concurrent page fault handler while collapsing a huge
page. Page fault handler needs a stable PMD to use PTL and relies on
per-VMA lock to prevent concurrent PMD changes. pmdp_collapse_flush(),
set_huge_pmd() and collapse_and_free_pmd() can modify a PMD, which will
not be detected by a page fault handler without proper locking.

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
mm/khugepaged.c