aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/proc/task_mmu.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 442177b1119a..2101ce46a5d2 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -737,9 +737,6 @@ static inline void clear_soft_dirty(struct vm_area_struct *vma,
737 ptent = pte_file_clear_soft_dirty(ptent); 737 ptent = pte_file_clear_soft_dirty(ptent);
738 } 738 }
739 739
740 if (vma->vm_flags & VM_SOFTDIRTY)
741 vma->vm_flags &= ~VM_SOFTDIRTY;
742
743 set_pte_at(vma->vm_mm, addr, pte, ptent); 740 set_pte_at(vma->vm_mm, addr, pte, ptent);
744#endif 741#endif
745} 742}
@@ -807,8 +804,9 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
807 804
808 if (type == CLEAR_REFS_SOFT_DIRTY) { 805 if (type == CLEAR_REFS_SOFT_DIRTY) {
809 soft_dirty_cleared = true; 806 soft_dirty_cleared = true;
810 pr_warn_once("The pagemap bits 55-60 has changed their meaning! " 807 pr_warn_once("The pagemap bits 55-60 has changed their meaning!"
811 "See the linux/Documentation/vm/pagemap.txt for details.\n"); 808 " See the linux/Documentation/vm/pagemap.txt for "
809 "details.\n");
812 } 810 }
813 811
814 task = get_proc_task(file_inode(file)); 812 task = get_proc_task(file_inode(file));
@@ -839,11 +837,17 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
839 * 837 *
840 * Writing 3 to /proc/pid/clear_refs only affects file 838 * Writing 3 to /proc/pid/clear_refs only affects file
841 * mapped pages. 839 * mapped pages.
840 *
841 * Writing 4 to /proc/pid/clear_refs affects all pages.
842 */ 842 */
843 if (type == CLEAR_REFS_ANON && vma->vm_file) 843 if (type == CLEAR_REFS_ANON && vma->vm_file)
844 continue; 844 continue;
845 if (type == CLEAR_REFS_MAPPED && !vma->vm_file) 845 if (type == CLEAR_REFS_MAPPED && !vma->vm_file)
846 continue; 846 continue;
847 if (type == CLEAR_REFS_SOFT_DIRTY) {
848 if (vma->vm_flags & VM_SOFTDIRTY)
849 vma->vm_flags &= ~VM_SOFTDIRTY;
850 }
847 walk_page_range(vma->vm_start, vma->vm_end, 851 walk_page_range(vma->vm_start, vma->vm_end,
848 &clear_refs_walk); 852 &clear_refs_walk);
849 } 853 }