From: Andrea Arcangeli on
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(a)redhat.com>

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(a)redhat.com>
---

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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/