Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ffe1e78

Browse files
xzpeterakpm00
authored andcommitted
mm/gup: cleanup next_page handling
The only path that doesn't use generic "**pages" handling is the gate vma. Make it use the same path, meanwhile tune the next_page label upper to cover "**pages" handling. This prepares for THP handling for "**pages". Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Lorenzo Stoakes <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: James Houghton <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: John Hubbard <[email protected]> Cc: Kirill A . Shutemov <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Mike Rapoport (IBM) <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Yang Shi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 5502ea4 commit ffe1e78

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mm/gup.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ static long __get_user_pages(struct mm_struct *mm,
12071207
if (!vma && in_gate_area(mm, start)) {
12081208
ret = get_gate_page(mm, start & PAGE_MASK,
12091209
gup_flags, &vma,
1210-
pages ? &pages[i] : NULL);
1210+
pages ? &page : NULL);
12111211
if (ret)
12121212
goto out;
12131213
ctx.page_mask = 0;
@@ -1277,19 +1277,18 @@ static long __get_user_pages(struct mm_struct *mm,
12771277
ret = PTR_ERR(page);
12781278
goto out;
12791279
}
1280-
1281-
goto next_page;
12821280
} else if (IS_ERR(page)) {
12831281
ret = PTR_ERR(page);
12841282
goto out;
12851283
}
1284+
next_page:
12861285
if (pages) {
12871286
pages[i] = page;
12881287
flush_anon_page(vma, page, start);
12891288
flush_dcache_page(page);
12901289
ctx.page_mask = 0;
12911290
}
1292-
next_page:
1291+
12931292
page_increm = 1 + (~(start >> PAGE_SHIFT) & ctx.page_mask);
12941293
if (page_increm > nr_pages)
12951294
page_increm = nr_pages;

0 commit comments

Comments
 (0)