forget that, of course if write_access is set it means we can write to
the page or the page fault would be finished much earlier. This looks
much better:
--- 2.4.10pre12aa1/mm/memory.c.~1~ Thu Sep 20 07:20:03 2001
+++ 2.4.10pre12aa1/mm/memory.c Thu Sep 20 08:24:03 2001
@@ -1156,13 +1156,11 @@
swap_free(entry);
if (exclusive_swap_page(page)) {
-#if 0
if (write_access)
pte = pte_mkwrite(pte_mkdirty(pte));
-#else
+ else if (vma->vm_flags & VM_WRITE)
+ pte = pte_mkwrite(pte);
delete_from_swap_cache_nolock(page);
- pte = pte_mkwrite(pte_mkdirty(pte));
-#endif
}
UnlockPage(page);
(we'll avoid the page fault this way in the "read" swapin too, by
checking if we're allowed to write to it or not, looks worthwhile check,
however it matters only for the archs where the dirty bit is set in
hardware)
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/