The patch titled Subject: mm/shmem: make find_get_pages_range() work for huge page has been added to the -mm tree. Its filename is mm-shmem-make-find_get_pages_range-work-for-huge-page.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-shmem-make-find_get_pages_range-work-for-huge-page.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-shmem-make-find_get_pages_range-work-for-huge-page.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Yu Zhao <yuzhao@xxxxxxxxxx> Subject: mm/shmem: make find_get_pages_range() work for huge page find_get_pages_range() and find_get_pages_range_tag() already correctly increment reference count on head when seeing compound page, but they may still use page index from tail. Page index from tail is always zero, so these functions don't work on huge shmem. This hasn't been a problem because, AFAIK, nobody calls these functions on (huge) shmem. Fix them anyway just in case. Link: http://lkml.kernel.org/r/20190110030838.84446-1-yuzhao@xxxxxxxxxx Signed-off-by: Yu Zhao <yuzhao@xxxxxxxxxx> Reviewed-by: William Kucharski <william.kucharski@xxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Amir Goldstein <amir73il@xxxxxxxxx> Cc: Dave Chinner <david@xxxxxxxxxxxxx> Cc: "Darrick J . Wong" <darrick.wong@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Souptick Joarder <jrdr.linux@xxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: "Kirill A . Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/filemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/filemap.c~mm-shmem-make-find_get_pages_range-work-for-huge-page +++ a/mm/filemap.c @@ -1789,7 +1789,7 @@ unsigned find_get_pages_range(struct add pages[ret] = page; if (++ret == nr_pages) { - *start = page->index + 1; + *start = xas.xa_index + 1; goto out; } continue; @@ -1927,7 +1927,7 @@ unsigned find_get_pages_range_tag(struct pages[ret] = page; if (++ret == nr_pages) { - *index = page->index + 1; + *index = xas.xa_index + 1; goto out; } continue; _ Patches currently in -mm which might be from yuzhao@xxxxxxxxxx are mm-fix-potential-build-error-in-compactionh.patch mm-shmem-make-find_get_pages_range-work-for-huge-page.patch mm-dont-expose-page-to-fast-gup-before-its-ready.patch