swap read ahead bug

From: Roman Zippel (zippel@linux-m68k.org)
Date: Sun Jul 08 2001 - 17:55:02 EST


Hi,

In do_swap_page() we don't flush read ahead pages to memory, so the cpu
might read the wrong data into the icache. I can reproduce this on my ppc
machine and the patch below fixes this problem.
If the patch is ok, you might also want to remove the wait_on_page() since
the following lock_page() implies this wait already.

bye, Roman

diff -u -r1.1.1.13 -r1.3
--- mm/memory.c 2001/07/08 15:05:26 1.1.1.13
+++ mm/memory.c 2001/07/08 17:12:37 1.3
@@ -1109,8 +1109,6 @@
                         return -1;
                 }
                 wait_on_page(page);
- flush_page_to_ram(page);
- flush_icache_page(vma, page);
         }

         /*
@@ -1140,6 +1138,8 @@
                 pte = pte_mkwrite(pte_mkdirty(pte));
         UnlockPage(page);

+ flush_page_to_ram(page);
+ flush_icache_page(vma, page);
         set_pte(page_table, pte);

         /* No need to invalidate - it was non-present before */

-
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/



This archive was generated by hypermail 2b29 : Sun Jul 15 2001 - 21:00:09 EST