Message ID | 20210610222517.nyqjt_Ebs%akpm@linux-foundation.org |
---|---|
State | Superseded |
Headers | show |
Series | + mm-page_vma_mapped_walk-crossing-page-table-boundary.patch added to -mm tree | expand |
--- a/mm/page_vma_mapped.c~mm-page_vma_mapped_walk-crossing-page-table-boundary +++ a/mm/page_vma_mapped.c @@ -247,16 +247,16 @@ next_pte: if (pvmw->address >= end) return not_found(pvmw); /* Did we cross page table boundary? */ - if (pvmw->address % PMD_SIZE == 0) { - pte_unmap(pvmw->pte); + if ((pvmw->address & (PMD_SIZE - PAGE_SIZE)) == 0) { if (pvmw->ptl) { spin_unlock(pvmw->ptl); pvmw->ptl = NULL; } + pte_unmap(pvmw->pte); + pvmw->pte = NULL; goto restart; - } else { - pvmw->pte++; } + pvmw->pte++; } while (pte_none(*pvmw->pte)); if (!pvmw->ptl) {