Skip to content

Commit 4a5e85f

Browse files
davidhildenbrandakpm00
authored andcommitted
fs/proc/task_mmu: fix PAGE_IS_PFNZERO detection for the huge zero folio
is_zero_pfn() does not work for the huge zero folio. Fix it by using is_huge_zero_pmd(). This can cause the PAGEMAP_SCAN ioctl against /proc/pid/pagemap to present pages as PAGE_IS_PRESENT rather than as PAGE_IS_PFNZERO. Found by code inspection. Link: https://lkml.kernel.org/r/[email protected] Fixes: 52526ca ("fs/proc/task_mmu: implement IOCTL to get and optionally clear info about PTEs") Signed-off-by: David Hildenbrand <[email protected]> Cc: Muhammad Usama Anjum <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 78f4e73 commit 4a5e85f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/proc/task_mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2182,7 +2182,7 @@ static unsigned long pagemap_thp_category(struct pagemap_scan_private *p,
21822182
categories |= PAGE_IS_FILE;
21832183
}
21842184

2185-
if (is_zero_pfn(pmd_pfn(pmd)))
2185+
if (is_huge_zero_pmd(pmd))
21862186
categories |= PAGE_IS_PFNZERO;
21872187
if (pmd_soft_dirty(pmd))
21882188
categories |= PAGE_IS_SOFT_DIRTY;

0 commit comments

Comments
 (0)