aboutsummaryrefslogtreecommitdiffstats
path: root/mm/fremap.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2014-06-04 19:06:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:53:56 -0400
commit0bf073315cb29d2e9e68b6c5da97862a519e3320 (patch)
treeb9ebb344d324b13211d3e9f1784d13684a420117 /mm/fremap.c
parent52383431b37cdbec63944e953ffc2698a7ad9722 (diff)
mm: softdirty: make freshly remapped file pages being softdirty unconditionally
Hugh reported: | I noticed your soft_dirty work in install_file_pte(): which looked | good at first, until I realized that it's propagating the soft_dirty | of a pte it's about to zap completely, to the unrelated entry it's | about to insert in its place. Which seems very odd to me. Indeed this code ends up being nop in result -- pte_file_mksoft_dirty() operates with pte_t argument and returns new pte_t which were never used after. After looking more I think what we need is to soft-dirtify all newely remapped file pages because it should look like a new mapping for memory tracker. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Reported-by: Hugh Dickins <hughd@google.com> Cc: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/fremap.c')
-rw-r--r--mm/fremap.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/fremap.c b/mm/fremap.c
index 34feba60a17e..2c5646f11f41 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -82,13 +82,10 @@ static int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma,
82 82
83 ptfile = pgoff_to_pte(pgoff); 83 ptfile = pgoff_to_pte(pgoff);
84 84
85 if (!pte_none(*pte)) { 85 if (!pte_none(*pte))
86 if (pte_present(*pte) && pte_soft_dirty(*pte))
87 pte_file_mksoft_dirty(ptfile);
88 zap_pte(mm, vma, addr, pte); 86 zap_pte(mm, vma, addr, pte);
89 }
90 87
91 set_pte_at(mm, addr, pte, ptfile); 88 set_pte_at(mm, addr, pte, pte_file_mksoft_dirty(ptfile));
92 /* 89 /*
93 * We don't need to run update_mmu_cache() here because the "file pte" 90 * We don't need to run update_mmu_cache() here because the "file pte"
94 * being installed by install_file_pte() is not a real pte - it's a 91 * being installed by install_file_pte() is not a real pte - it's a