mm, /proc/pid/pagemap: fix soft dirty marking for PMD migration entry

When the pagetable is walked in the implementation of /proc/<pid>/pagemap,
pmd_soft_dirty() is used for both the PMD huge page map and the PMD
migration entries.  That is wrong, pmd_swp_soft_dirty() should be used
for the PMD migration entries instead because the different page table
entry flag is used.

As a result, /proc/pid/pagemap may report incorrect soft dirty information
for PMD migration entries.

Fixes: 84c3fc4e9c56 ("mm: thp: check pmd migration entry in common path")
Signed-off-by: "Huang, Ying" <>
Acked-by: Kirill A. Shutemov <>
Acked-by: Naoya Horiguchi <>
Cc: Michal Hocko <>
Cc: David Rientjes <>
Cc: Arnd Bergmann <>
Cc: Hugh Dickins <>
Cc: "Jérôme Glisse" <>
Cc: Daniel Colascione <>
Cc: Zi Yan <>
Cc: Anshuman Khandual <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed