aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorLaurent Dufour <ldufour@linux.vnet.ibm.com>2015-11-05 21:49:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 22:34:48 -0500
commit326c2597a3b93b8a89e0c3a2b41fd9971d095a97 (patch)
treea2734ff4c8a58494e68f273ae4fc923438ed2c24 /fs/proc
parentc8f95ed1a9ce373d20d3b09a6a9fb91c8beef27e (diff)
mm: clear pte in clear_soft_dirty()
As mentioned in the commit 56eecdb912b5 ("mm: Use ptep/pmdp_set_numa() for updating _PAGE_NUMA bit"), architectures like ppc64 don't do tlb flush in set_pte/pmd functions. So when dealing with existing pte in clear_soft_dirty, the pte must be cleared before being modified. Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/task_mmu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 288185e24762..ef44bb474ea2 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -792,19 +792,20 @@ static inline void clear_soft_dirty(struct vm_area_struct *vma,
792 pte_t ptent = *pte; 792 pte_t ptent = *pte;
793 793
794 if (pte_present(ptent)) { 794 if (pte_present(ptent)) {
795 ptent = ptep_modify_prot_start(vma->vm_mm, addr, pte);
795 ptent = pte_wrprotect(ptent); 796 ptent = pte_wrprotect(ptent);
796 ptent = pte_clear_soft_dirty(ptent); 797 ptent = pte_clear_soft_dirty(ptent);
798 ptep_modify_prot_commit(vma->vm_mm, addr, pte, ptent);
797 } else if (is_swap_pte(ptent)) { 799 } else if (is_swap_pte(ptent)) {
798 ptent = pte_swp_clear_soft_dirty(ptent); 800 ptent = pte_swp_clear_soft_dirty(ptent);
801 set_pte_at(vma->vm_mm, addr, pte, ptent);
799 } 802 }
800
801 set_pte_at(vma->vm_mm, addr, pte, ptent);
802} 803}
803 804
804static inline void clear_soft_dirty_pmd(struct vm_area_struct *vma, 805static inline void clear_soft_dirty_pmd(struct vm_area_struct *vma,
805 unsigned long addr, pmd_t *pmdp) 806 unsigned long addr, pmd_t *pmdp)
806{ 807{
807 pmd_t pmd = *pmdp; 808 pmd_t pmd = pmdp_huge_get_and_clear(vma->vm_mm, addr, pmdp);
808 809
809 pmd = pmd_wrprotect(pmd); 810 pmd = pmd_wrprotect(pmd);
810 pmd = pmd_clear_soft_dirty(pmd); 811 pmd = pmd_clear_soft_dirty(pmd);