/* Create the new pte value */
new_pte = mk_pte(new_page, vma->vm_page_prot);
if (pte_write(pte))
new_pte = pte_mkwrite(new_pte);
if (pte_dirty(pte))
new_pte = pte_mkdirty(new_pte);
/*
* Unmap the page before doing the copy,
* in case another CPU is writing to it.
*/
flush_cache_page(vma, addr);
pte_clear(dir);
flush_tlb_page(vma, addr);
/* copy the data */
copy_page(new_page, old_page);
flush_page_to_ram(new_page);
flush_page_to_ram(old_page);
/* install the new pte */
set_pte(dir, new_pte);
The page replacement is now like a back-to-back swapout/swapin with a
copy to a different page, so it should be conceptually sound.
If nobody spots any other problems, I'll post the defragger patch later
this afternoon. The defragger is now much better at building 16K and 32K
pages, and I hope it will be a useful addition to the vm arsenal.
Regards,
Bill
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html