]> git.baikalelectronics.ru Git - kernel.git/commit
mm/rmap: Fix handling of hugetlbfs pages in page_vma_mapped_walk
authorzhenwei pi <pizhenwei@bytedance.com>
Thu, 7 Apr 2022 06:40:08 +0000 (14:40 +0800)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 7 Apr 2022 14:11:20 +0000 (10:11 -0400)
commit6a5e58b060a9bac6aa63438f6e12f746d9c21be5
tree99da71c406f2e47fa427ce62d21155ccf7637536
parent700b6f3843efbade6f424ba845e66db99f7d4f45
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: 8d8351895f809 ("mm: Convert page_vma_mapped_walk to work on PFNs")
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
[edit commit message, use hstate directly]
mm/page_vma_mapped.c