Message ID | 20210625013914.f4FSy3CBd%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | [01/24] mm: page_vma_mapped_walk(): use page for pvmw->page | expand |
--- a/mm/page_vma_mapped.c~mm-page_vma_mapped_walk-crossing-page-table-boundary +++ a/mm/page_vma_mapped.c @@ -244,16 +244,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) {