diff options
| author | David Hildenbrand <[email protected]> | 2025-06-17 14:35:32 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-06-25 22:55:03 +0000 |
| commit | 4a5e85f4eb8fd18b1266342d100e4f0849544ca0 (patch) | |
| tree | de291e492f82add43cade7f1734a241039c971b3 /fs/proc/task_mmu.c | |
| parent | Merge tag 'for-6.16/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
| download | kernel-4a5e85f4eb8fd18b1266342d100e4f0849544ca0.tar.gz kernel-4a5e85f4eb8fd18b1266342d100e4f0849544ca0.zip | |
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: 52526ca7fdb9 ("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]>
Diffstat (limited to 'fs/proc/task_mmu.c')
| -rw-r--r-- | fs/proc/task_mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 27972c0749e7..4be91eb6ea5c 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -2182,7 +2182,7 @@ static unsigned long pagemap_thp_category(struct pagemap_scan_private *p, categories |= PAGE_IS_FILE; } - if (is_zero_pfn(pmd_pfn(pmd))) + if (is_huge_zero_pmd(pmd)) categories |= PAGE_IS_PFNZERO; if (pmd_soft_dirty(pmd)) categories |= PAGE_IS_SOFT_DIRTY; |
