Skip to content

Commit f003c03

Browse files
Hugh Dickinstorvalds
authored andcommitted
mm: page_vma_mapped_walk(): use page for pvmw->page
Patch series "mm: page_vma_mapped_walk() cleanup and THP fixes". I've marked all of these for stable: many are merely cleanups, but I think they are much better before the main fix than after. This patch (of 11): page_vma_mapped_walk() cleanup: sometimes the local copy of pvwm->page was used, sometimes pvmw->page itself: use the local copy "page" throughout. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Hugh Dickins <[email protected]> Reviewed-by: Alistair Popple <[email protected]> Acked-by: Kirill A. Shutemov <[email protected]> Reviewed-by: Peter Xu <[email protected]> Cc: Yang Shi <[email protected]> Cc: Wang Yugui <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Ralph Campbell <[email protected]> Cc: Zi Yan <[email protected]> Cc: Will Deacon <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4a09d38 commit f003c03

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

mm/page_vma_mapped.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
156156
if (pvmw->pte)
157157
goto next_pte;
158158

159-
if (unlikely(PageHuge(pvmw->page))) {
159+
if (unlikely(PageHuge(page))) {
160160
/* when pud is not present, pte will be NULL */
161161
pvmw->pte = huge_pte_offset(mm, pvmw->address, page_size(page));
162162
if (!pvmw->pte)
@@ -217,8 +217,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
217217
* cannot return prematurely, while zap_huge_pmd() has
218218
* cleared *pmd but not decremented compound_mapcount().
219219
*/
220-
if ((pvmw->flags & PVMW_SYNC) &&
221-
PageTransCompound(pvmw->page)) {
220+
if ((pvmw->flags & PVMW_SYNC) && PageTransCompound(page)) {
222221
spinlock_t *ptl = pmd_lock(mm, pvmw->pmd);
223222

224223
spin_unlock(ptl);
@@ -234,9 +233,9 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
234233
return true;
235234
next_pte:
236235
/* Seek to next pte only makes sense for THP */
237-
if (!PageTransHuge(pvmw->page) || PageHuge(pvmw->page))
236+
if (!PageTransHuge(page) || PageHuge(page))
238237
return not_found(pvmw);
239-
end = vma_address_end(pvmw->page, pvmw->vma);
238+
end = vma_address_end(page, pvmw->vma);
240239
do {
241240
pvmw->address += PAGE_SIZE;
242241
if (pvmw->address >= end)

0 commit comments

Comments
 (0)