diff mbox

COW break issue. Where is the patch ?

Message ID 20110223235313.GA258@hiauly1.hia.nrc.ca (mailing list archive)
State Rejected
Headers show

Commit Message

John David Anglin Feb. 23, 2011, 11:53 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index 5d7b8ce..4924e23 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -450,20 +450,7 @@  static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
 	return old_pte;
 }
 
-static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-{
-#ifdef CONFIG_SMP
-	unsigned long new, old;
-
-	do {
-		old = pte_val(*ptep);
-		new = pte_val(pte_wrprotect(__pte (old)));
-	} while (cmpxchg((unsigned long *) ptep, old, new) != old);
-#else
-	pte_t old_pte = *ptep;
-	set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
-#endif
-}
+extern void ptep_set_wrprotect(struct mm_struct *, unsigned long, pte_t *);
 
 #define pte_same(A,B)	(pte_val(A) == pte_val(B))
 
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 3f11331..a16430d 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -502,3 +531,22 @@  flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
 	__flush_cache_page(vma, vmaddr, page_to_phys(pfn_to_page(pfn)));
 
 }
+
+void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
+{
+#ifdef CONFIG_SMP
+        unsigned long new, old;
+
+        if (atomic_read(&mm->mm_users) > 1)
+                flush_dcache_page(pte_page(*ptep));
+        do {
+                old = pte_val(*ptep);
+                new = pte_val(pte_wrprotect(__pte (old)));
+        } while (cmpxchg((unsigned long *) ptep, old, new) != old);
+#else
+        pte_t old_pte = *ptep;
+        if (atomic_read(&mm->mm_users) > 1)
+                flush_dcache_page(pte_page(old_pte));
+        set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
+#endif
+}