patch-2.4.7 linux/mm/memory.c

Next file: linux/mm/oom_kill.c
Previous file: linux/mm/filemap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/mm/memory.c linux/mm/memory.c
@@ -888,8 +888,7 @@
  * change only once the write actually happens. This avoids a few races,
  * and potentially makes it more efficient.
  *
- * We enter with the page table read-lock held, and need to exit without
- * it.
+ * We hold the mm semaphore and the page_table_lock on entry and exit.
  */
 static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
 	unsigned long address, pte_t *page_table, pte_t pte)
@@ -1108,9 +1107,6 @@
 			spin_lock(&mm->page_table_lock);
 			return -1;
 		}
-		wait_on_page(page);
-		flush_page_to_ram(page);
-		flush_icache_page(vma, page);
 	}
 
 	/*
@@ -1140,6 +1136,8 @@
 		pte = pte_mkwrite(pte_mkdirty(pte));
 	UnlockPage(page);
 
+	flush_page_to_ram(page);
+	flush_icache_page(vma, page);
 	set_pte(page_table, pte);
 
 	/* No need to invalidate - it was non-present before */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)