lkml.org 
[lkml]   [2001]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectswap read ahead bug
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/

\
 
 \ /
  Last update: 2005-03-22 12:56    [W:0.045 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site