Commit e9cdd6e771580e6ff872e5c64e8b766972c7d1bc
Committed by
Linus Torvalds
1 parent
c3d16e1652
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
mm: /proc/pid/pagemap: inspect _PAGE_SOFT_DIRTY only on present pages
If a page we are inspecting is in swap we may occasionally report it as having soft dirty bit (even if it is clean). The pte_soft_dirty helper should be called on present pte only. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Matt Mackall <mpm@selenic.com> Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Peter Zijlstra <peterz@infradead.org> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
fs/proc/task_mmu.c
... | ... | @@ -941,6 +941,8 @@ |
941 | 941 | frame = pte_pfn(pte); |
942 | 942 | flags = PM_PRESENT; |
943 | 943 | page = vm_normal_page(vma, addr, pte); |
944 | + if (pte_soft_dirty(pte)) | |
945 | + flags2 |= __PM_SOFT_DIRTY; | |
944 | 946 | } else if (is_swap_pte(pte)) { |
945 | 947 | swp_entry_t entry; |
946 | 948 | if (pte_swp_soft_dirty(pte)) |
... | ... | @@ -960,7 +962,7 @@ |
960 | 962 | |
961 | 963 | if (page && !PageAnon(page)) |
962 | 964 | flags |= PM_FILE; |
963 | - if ((vma->vm_flags & VM_SOFTDIRTY) || pte_soft_dirty(pte)) | |
965 | + if ((vma->vm_flags & VM_SOFTDIRTY)) | |
964 | 966 | flags2 |= __PM_SOFT_DIRTY; |
965 | 967 | |
966 | 968 | *pme = make_pme(PM_PFRAME(frame) | PM_STATUS2(pm->v2, flags2) | flags); |