--- 2.4.10pre12aa2/mm/vmscan.c.~1~ Thu Sep 20 20:14:18 2001 +++ 2.4.10pre12aa2/mm/vmscan.c Fri Sep 21 03:48:42 2001 @@ -75,6 +75,14 @@ flush_tlb_page(vma, address); /* + * Despite of our xchg, only here (after the tlb flush) we + * are sure the cpu cannot set set the dirty bit on the + * pagetable any longer. + */ + if (ptep_test_and_clear_dirty(page_table)) + pte = pte_mkdirty(pte); + + /* * Is the page already in the swap cache? If so, then * we can just drop our reference to it without doing * any IO - it's already up-to-date on disk.