On Wed, Jun 30, 2010 at 11:37:10AM -0400, Rik van Riel wrote: > @@ -2714,10 +2715,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, > if ((flags & FAULT_FLAG_WRITE) && reuse_swap_page(page)) { > pte = maybe_mkwrite(pte_mkdirty(pte), vma); > flags &= ~FAULT_FLAG_WRITE; > + exclusive = 1; > } Agreed. it's something I considered doing too but I deferred until I figure out all the mess with ksm-copy. I'll test your patch but it should make no practical difference to my workload. I also had a patch in my queue that changes this path which I deferred as well for now. ==== Subject: set VM_FAULT_WRITE in do_swap_page From: Andrea Arcangeli <aarcange@xxxxxxxxxx> Set the flag if do_swap_page is decowing the page the same way do_wp_page would too. Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> --- diff --git a/mm/memory.c b/mm/memory.c --- a/mm/memory.c +++ b/mm/memory.c @@ -2673,6 +2686,7 @@ static int do_swap_page(struct mm_struct if ((flags & FAULT_FLAG_WRITE) && reuse_swap_page(page)) { pte = maybe_mkwrite(pte_mkdirty(pte), vma); flags &= ~FAULT_FLAG_WRITE; + ret |= VM_FAULT_WRITE; } flush_icache_page(vma, page); set_pte_at(mm, address, page_table, pte); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>