On Mon, May 24, 2021 at 10:34 PM Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxx> wrote: > > @@ -221,6 +222,9 @@ static inline void page_vma_mapped_walk_done(struct page_vma_mapped_walk *pvmw) > spin_unlock(pvmw->pte_ptl); > if (pvmw->pmd_ptl) > spin_unlock(pvmw->pmd_ptl); > + if (pvmw->pud_ptl) > + spin_unlock(pvmw->pud_ptl); > + > } You have this habit of adding odd whitespace.. But yes, this seems to be the right way to fix the races properly. The pageout code is special, the pageout code is normally not critical, so it's the pageout code that should go the extra mile to make up for the fact that it doesn't hold the mmap_sem like good page table modification codepaths do. Linus