aboutsummaryrefslogtreecommitdiff
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-10-29 18:15:55 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-29 21:40:36 -0700
commit72866f6f277ec0ddd6df7a3b6ecdcf59a28de115 (patch)
treea76bb7fb8e092250c4399c20f0c7c973b77cb0bb /mm/swapfile.c
parent6237bcd94851e9cf0ecd2520d744779df0f5a9a6 (diff)
downloadlinux-linaro-72866f6f277ec0ddd6df7a3b6ecdcf59a28de115.tar.gz
[PATCH] mm: anon is already wrprotected
do_anonymous_page's pte_wrprotect causes some confusion: in such a case, vm_page_prot must already be forcing COW, so must omit write permission, and so the pte_wrprotect is redundant. Replace it by a comment to that effect, and reword the comment on unuse_pte which also caused confusion. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 1dcaeda039f..05c85129124 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -398,10 +398,9 @@ void free_swap_and_cache(swp_entry_t entry)
}
/*
- * Always set the resulting pte to be nowrite (the same as COW pages
- * after one process has exited). We don't know just how many PTEs will
- * share this swap entry, so be cautious and let do_wp_page work out
- * what to do if a write is requested later.
+ * No need to decide whether this PTE shares the swap entry with others,
+ * just let do_wp_page work it out if a write is requested later - to
+ * force COW, vm_page_prot omits write permission from any private vma.
*
* vma->vm_mm->page_table_lock is held.
*/