]> err.no Git - linux-2.6/blobdiff - mm/mremap.c
[PATCH] cpusets: oom_kill tweaks
[linux-2.6] / mm / mremap.c
index fc45dc9a617b013f4db5aea5fe7898bf6cd677b6..a32fed454bd7c60e15da0c720b1631b55a3f8835 100644 (file)
@@ -141,6 +141,10 @@ move_one_page(struct vm_area_struct *vma, unsigned long old_addr,
                        if (dst) {
                                pte_t pte;
                                pte = ptep_clear_flush(vma, old_addr, src);
+                               /* ZERO_PAGE can be dependant on virtual addr */
+                               if (pfn_valid(pte_pfn(pte)) &&
+                                       pte_page(pte) == ZERO_PAGE(old_addr))
+                                       pte = pte_wrprotect(mk_pte(ZERO_PAGE(new_addr), new_vma->vm_page_prot));
                                set_pte_at(mm, new_addr, dst, pte);
                        } else
                                error = -ENOMEM;