Skip to content
Commit 98ea0259 authored by zhenwei pi's avatar zhenwei pi Committed by Matthew Wilcox (Oracle)
Browse files

mm/rmap: Fix handling of hugetlbfs pages in page_vma_mapped_walk

page_mapped_in_vma() sets nr_pages to 1, which is usually correct as we
only want to know about the precise page and not about other pages in
the folio.  However, hugetlbfs does want to know about the entire hpage,
and using nr_pages to get the size of the hpage is wrong.  We could
change page_mapped_in_vma() to special-case hugetlbfs pages, but it's
better to ignore nr_pages in page_vma_mapped_walk() and get the size
from the VMA instead.

Fixes: 2aff7a47

 ("mm: Convert page_vma_mapped_walk to work on PFNs")
Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
Reviewed-by: default avatarMuchun Song <songmuchun@bytedance.com>
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
[edit commit message, use hstate directly]
parent ec4858e0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment